1
Fork 0

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 ad65f15581)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
This commit is contained in:
Miss Islington (bot) 2018-11-16 08:32:07 -08:00 committed by GitHub
parent 2907d93889
commit e45fa7393b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -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;