Add a missed PyErr_NoMemory() in symtable_new(). (GH-10576)
This missed PyErr_NoMemory() could cause a SystemError when calling
_symtable.symtable().
(cherry picked from commit ad65f15581
)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
This commit is contained in:
parent
0461c3b635
commit
0ee5409aea
|
@ -215,8 +215,10 @@ symtable_new(void)
|
||||||
struct symtable *st;
|
struct symtable *st;
|
||||||
|
|
||||||
st = (struct symtable *)PyMem_Malloc(sizeof(struct symtable));
|
st = (struct symtable *)PyMem_Malloc(sizeof(struct symtable));
|
||||||
if (st == NULL)
|
if (st == NULL) {
|
||||||
|
PyErr_NoMemory();
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
st->st_filename = NULL;
|
st->st_filename = NULL;
|
||||||
st->st_blocks = NULL;
|
st->st_blocks = NULL;
|
||||||
|
|
Loading…
Reference in New Issue