]> granicus.if.org Git - python/commitdiff
Fix [ #489673 ] memory leak in test_symtable: Free the st_future slot.
authorJeremy Hylton <jeremy@alum.mit.edu>
Thu, 6 Dec 2001 14:34:58 +0000 (14:34 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Thu, 6 Dec 2001 14:34:58 +0000 (14:34 +0000)
The st_future slot of the symtable is not freed by PySymtable_Free()
because it is shared by the symtable and compiling structs in
compiel.c.  Since it is shared, it is explicitly deallocated when the
compiling struct is freed.

Modules/symtablemodule.c

index 24525212f3430a7f2559ddb050eebc26b9166e71..e24e72fb10f5a91dbebbe67dcae7511000698a57 100644 (file)
@@ -32,6 +32,7 @@ symtable_symtable(PyObject *self, PyObject *args)
        if (st == NULL)
                return NULL;
        t = Py_BuildValue("O", st->st_symbols);
+       PyMem_Free((void *)st->st_future);
        PySymtable_Free(st);
        return t;
 }