8000 Add a missed PyErr_NoMemory() in symtable_new(). (GH-10576) · python/cpython@0ee5409 · GitHub
[go: up one dir, main page]

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 <zspytz@gmail.com>
1 parent 0461c3b commit 0ee5409

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
@@ -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)
0