diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2018-11-16 16:32:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-16 16:32:07 (GMT) |
commit | e45fa7393b3e9eb3f1879305ad851f1db2809996 (patch) | |
tree | 7f8657a2d6f12d2d3a6e8e8e1e36a7e017a7e680 | |
parent | 2907d93889b67cda4041c4cb716521ee70af3703 (diff) | |
download | cpython-e45fa7393b3e9eb3f1879305ad851f1db2809996.zip cpython-e45fa7393b3e9eb3f1879305ad851f1db2809996.tar.gz cpython-e45fa7393b3e9eb3f1879305ad851f1db2809996.tar.bz2 |
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>
-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 21790b1..23aeaaa 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -199,8 +199,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_symbols = NULL; |