summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-11-16 08:31:47 -0800
committerGitHub <noreply@github.com>2018-11-16 08:31:47 -0800
commit0ee5409aea7eefd6a0deff697247657c75437c4e (patch)
tree4907ce03d82d00936ebf05aafd4b5067e40ebb3a /Python
parent0461c3b635d53e8e75145695803a2fca288a1689 (diff)
downloadcpython-git-0ee5409aea7eefd6a0deff697247657c75437c4e.tar.gz
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 ad65f15581173542f1d2a9968a63bee272510ce3) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Diffstat (limited to 'Python')
-rw-r--r--Python/symtable.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/symtable.c b/Python/symtable.c
index 81eea95f49..177bb6d436 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -215,8 +215,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;