mirror of
https://github.com/python/cpython.git
synced 2025-11-02 19:12:55 +00:00
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.
This commit is contained in:
parent
d0342cdefa
commit
8c5e41559c
1 changed files with 4 additions and 1 deletions
|
|
@ -4043,9 +4043,12 @@ PyNode_CompileSymtable(node *n, char *filename)
|
||||||
ff = PyNode_Future(n, filename);
|
ff = PyNode_Future(n, filename);
|
||||||
if (ff == NULL)
|
if (ff == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
st = symtable_init();
|
st = symtable_init();
|
||||||
if (st == NULL)
|
if (st == NULL) {
|
||||||
|
PyMem_Free((void *)ff);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
st->st_future = ff;
|
st->st_future = ff;
|
||||||
symtable_enter_scope(st, TOP, TYPE(n), n->n_lineno);
|
symtable_enter_scope(st, TOP, TYPE(n), n->n_lineno);
|
||||||
if (st->st_errors > 0)
|
if (st->st_errors > 0)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue