Skip to content

Commit 0124040

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 8856246 commit 0124040

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
@@ -206,8 +206,10 @@ symtable_new(void)
206206
struct symtable *st;
207207

208208
st = (struct symtable *)PyMem_Malloc(sizeof(struct symtable));
209-
if (st == NULL)
209+
if (st == NULL) {
210+
PyErr_NoMemory();
210211
return NULL;
212+
}
211213

212214
st->st_filename = NULL;
213215
st->st_blocks = NULL;

0 commit comments

Comments
 (0)