]> granicus.if.org Git - python/commitdiff
Part of SF bug #478003 possible memory leaks in err handling.
authorTim Peters <tim.peters@gmail.com>
Sun, 4 Nov 2001 19:26:58 +0000 (19:26 +0000)
committerTim Peters <tim.peters@gmail.com>
Sun, 4 Nov 2001 19:26:58 +0000 (19:26 +0000)
PyNode_CompileSymtable:  if symtable_init() fails, free the memory
allocated for the PyFutureFeatures struct.

Python/compile.c

index f2cd59effb4e14896da1ed485acac74ce5b4d8fd..c8a56699bc1f11b55852369d1a0f7425a2bd88d4 100644 (file)
@@ -4043,9 +4043,12 @@ PyNode_CompileSymtable(node *n, char *filename)
        ff = PyNode_Future(n, filename);
        if (ff == NULL)
                return NULL;
+
        st = symtable_init();
-       if (st == NULL)
+       if (st == NULL) {
+               PyMem_Free((void *)ff);
                return NULL;
+       }
        st->st_future = ff;
        symtable_enter_scope(st, TOP, TYPE(n), n->n_lineno);
        if (st->st_errors > 0)