From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 26 Aug 2019 15:49:44 +0000 (-0700) Subject: bpo-37954: Fix reference leak in the symtable (GH-15514) X-Git-Tag: v3.8.0b4~33 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ed8af33cce5554545d2bd079b23fe551d26fb4bd;p=python bpo-37954: Fix reference leak in the symtable (GH-15514) (cherry picked from commit 4901dc46da5ecb131f8d902a0fbd704934f209e1) Co-authored-by: Pablo Galindo --- diff --git a/Python/symtable.c b/Python/symtable.c index 18ea57690b..2795e0f111 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -999,7 +999,9 @@ symtable_lookup(struct symtable *st, PyObject *name) PyObject *mangled = _Py_Mangle(st->st_private, name); if (!mangled) return 0; - return _PyST_GetSymbol(st->st_cur, mangled); + long ret = _PyST_GetSymbol(st->st_cur, mangled); + Py_DECREF(mangled); + return ret; } static int