]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Add a missed PyErr_NoMemory() in symtable_new(). (GH-10576)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 16 Nov 2018 16:31:57 +0000 (08:31 -0800)
committerGitHub <noreply@github.com>
Fri, 16 Nov 2018 16:31:57 +0000 (08:31 -0800)
This missed PyErr_NoMemory() could cause a SystemError when calling
_symtable.symtable().
(cherry picked from commit ad65f15581173542f1d2a9968a63bee272510ce3)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Python/symtable.c

index 90b07efa0334cc44f6b7cfe2562f0224ef936c05..aef845b59698e79b50ce3ced252ef0269c751909 100644 (file)
@@ -206,8 +206,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;