Fix refleak in compiler.
(A symbol table entry was leaked every time a class was compiled.)
diff --git a/Python/compile.c b/Python/compile.c
index 4c22441..a47c8e6 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -1519,6 +1519,7 @@
PyCodeObject *co;
PyObject *str;
PySTEntryObject *ste;
+ int err;
/* initialize statics */
if (build_class == NULL) {
@@ -1547,7 +1548,9 @@
if (ste == NULL)
return 0;
assert(PyList_Check(ste->ste_varnames));
- if (PyList_Append(ste->ste_varnames, locals) < 0)
+ err = PyList_Append(ste->ste_varnames, locals);
+ Py_DECREF(ste);
+ if (err < 0)
return 0;
/* 1. compile the class body into a code object */