Free coding spec (cs) if there was an error to prevent mem leak.
Maybe backport candidate.
[Bugfix seems applicable to 2.4 to me. --amk]
Core and builtins
-----------------
+- Fix memory leak of coding spec in Parser/tokenizer.c.
+
- Overflow checking code in integer division ran afoul of new gcc
optimizations. Changed to be more standard-conforming.
tok->encoding = cs;
tok->decoding_state = -1;
}
+ else
+ PyMem_DEL(cs);
#else
/* Without Unicode support, we cannot
process the coding spec. Since there
won't be any Unicode literals, that
won't matter. */
+ PyMem_DEL(cs);
#endif
}
} else { /* then, compare cs with BOM */