Add a missed PyErr_NoMemory() in symtable_new(). (GH-10576)
authorZackery Spytz <zspytz@gmail.com>
Fri, 16 Nov 2018 15:58:55 +0000 (08:58 -0700)
committerSerhiy Storchaka <storchaka@gmail.com>
Fri, 16 Nov 2018 15:58:55 +0000 (17:58 +0200)
This missed PyErr_NoMemory() could cause a SystemError when calling
_symtable.symtable().

Python/symtable.c

index c095c82eea8fb2ceef4c1fc8cd8e5977e463eceb..96f7bcda5e2665987a1188c69ee8820988bcd69e 100644 (file)
@@ -210,8 +210,10 @@ symtable_new(void)
     struct symtable *st;
 
     st = (struct symtable *)PyMem_Malloc(sizeof(struct symtable));
-    if (st == NULL)
+    if (st == NULL) {
+        PyErr_NoMemory();
         return NULL;
+    }
 
     st->st_filename = NULL;
     st->st_blocks = NULL;