diff options
author | Zackery Spytz <zspytz@gmail.com> | 2018-11-16 15:58:55 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2018-11-16 15:58:55 (GMT) |
commit | ad65f15581173542f1d2a9968a63bee272510ce3 (patch) | |
tree | 263595bf50a96416143d088c63ba15bab80fec2b /Python/symtable.c | |
parent | 90d0cfb22269261333e82a7c8a17b66d6695f7b6 (diff) | |
download | cpython-ad65f15581173542f1d2a9968a63bee272510ce3.zip cpython-ad65f15581173542f1d2a9968a63bee272510ce3.tar.gz cpython-ad65f15581173542f1d2a9968a63bee272510ce3.tar.bz2 |
Add a missed PyErr_NoMemory() in symtable_new(). (GH-10576)
This missed PyErr_NoMemory() could cause a SystemError when calling
_symtable.symtable().
Diffstat (limited to 'Python/symtable.c')
-rw-r--r-- | Python/symtable.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/symtable.c b/Python/symtable.c index c095c82..96f7bcd 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -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; |