Skip to content

Commit 0ee5409

Browse files
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 ad65f15) Co-authored-by: Zackery Spytz <[email protected]>
1 parent 0461c3b commit 0ee5409

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Python/symtable.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,10 @@ symtable_new(void)
215215
struct symtable *st;
216216

217217
st = (struct symtable *)PyMem_Malloc(sizeof(struct symtable));
218-
if (st == NULL)
218+
if (st == NULL) {
219+
PyErr_NoMemory();
219220
return NULL;
221+
}
220222

221223
st->st_filename = NULL;
222224
st->st_blocks = NULL;

0 commit comments

Comments
 (0)