Mercurial > cpython-lru_cache-weakref
diff Python/compile.c @ 20867:40a88989d6cb legacy-trunk
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.
| author | Tim Peters <tim.peters@gmail.com> |
|---|---|
| date | Sun, 04 Nov 2001 19:26:58 +0000 |
| parents | d51fe520e5fd |
| children | 13df8b6c2b80 |
line wrap: on
line diff
--- a/Python/compile.c Sun Nov 04 11:53:10 2001 +0000 +++ b/Python/compile.c Sun Nov 04 19:26:58 2001 +0000 @@ -4043,9 +4043,12 @@ 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)
