bpo-37954: Fix reference leak in the symtable (GH-15514)

This commit is contained in:
Pablo Galindo 2019-08-26 16:14:07 +01:00 committed by GitHub
parent 52c1a6a15a
commit 4901dc46da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -999,7 +999,9 @@ symtable_lookup(struct symtable *st, PyObject *name)
PyObject *mangled = _Py_Mangle(st->st_private, name); PyObject *mangled = _Py_Mangle(st->st_private, name);
if (!mangled) if (!mangled)
return 0; return 0;
return _PyST_GetSymbol(st->st_cur, mangled); long ret = _PyST_GetSymbol(st->st_cur, mangled);
Py_DECREF(mangled);
return ret;
} }
static int static int