diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-11-04 19:26:58 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-11-04 19:26:58 (GMT) |
commit | 8c5e41559c6f9c3493a03b69325a02b89c2d6d94 (patch) | |
tree | 8ea337b230c22970ff11a55c4099e245ee9d303b /Python | |
parent | d0342cdefa41dd912bbd3dcf774b333605893dd8 (diff) | |
download | cpython-8c5e41559c6f9c3493a03b69325a02b89c2d6d94.zip cpython-8c5e41559c6f9c3493a03b69325a02b89c2d6d94.tar.gz cpython-8c5e41559c6f9c3493a03b69325a02b89c2d6d94.tar.bz2 |
Part of SF bug #478003 possible memory leaks in err handling.
PyNode_CompileSymtable: if symtable_init() fails, free the memory
allocated for the PyFutureFeatures struct.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/compile.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c index f2cd59e..c8a5669 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -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) |