Author: guido.van.rossum
Date: Wed Mar 21 22:26:58 2007
New Revision: 54502

Modified:
   python/branches/p3yk/Python/compile.c
Log:
Fix refleak in compiler.
(A symbol table entry was leaked every time a class was compiled.)


Modified: python/branches/p3yk/Python/compile.c
==============================================================================
--- python/branches/p3yk/Python/compile.c       (original)
+++ python/branches/p3yk/Python/compile.c       Wed Mar 21 22:26:58 2007
@@ -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 */
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins

Reply via email to