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

Skip to content

Commit e45fa73

Browse files
Add a missed PyErr_NoMemory() in symtable_new 8000 (). (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 2907d93 commit e45fa73

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
@@ -199,8 +199,10 @@ symtable_new(void)
199199
struct symtable *st;
200200

201201
st = (struct symtable *)PyMem_Malloc(sizeof(struct symtable));
202-
if (st == NULL)
202+
if (st == NULL) {
203+
PyErr_NoMemory();
203204
return NULL;
205+
}
204206

205207
st->st_filename = NULL;
206208
st->st_symbols = NULL;

0 commit comments

Comments
 (0)
0