Skip to content

Commit ad65f15

Browse files
ZackerySpytzserhiy-storchaka
authored andcommitted
Add a missed PyErr_NoMemory() in symtable_new(). (GH-10576)
This missed PyErr_NoMemory() could cause a SystemError when calling _symtable.symtable().
1 parent 90d0cfb commit ad65f15

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Python/symtable.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,10 @@ symtable_new(void)
210210
struct symtable *st;
211211

212212
st = (struct symtable *)PyMem_Malloc(sizeof(struct symtable));
213-
if (st == NULL)
213+
if (st == NULL) {
214+
PyErr_NoMemory();
214215
return NULL;
216+
}
215217

216218
st->st_filename = NULL;
217219
st->st_blocks = NULL;

0 commit comments

Comments
 (0)