diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-08-26 15:49:44 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-26 15:49:44 (GMT) |
commit | ed8af33cce5554545d2bd079b23fe551d26fb4bd (patch) | |
tree | e6f24d1a0bd9862fc8b899bd9f32e033d6f17371 /Python | |
parent | 82f4bfdbb053eea1c67159b2d73717a21eb89893 (diff) | |
download | cpython-ed8af33cce5554545d2bd079b23fe551d26fb4bd.zip cpython-ed8af33cce5554545d2bd079b23fe551d26fb4bd.tar.gz cpython-ed8af33cce5554545d2bd079b23fe551d26fb4bd.tar.bz2 |
bpo-37954: Fix reference leak in the symtable (GH-15514)
(cherry picked from commit 4901dc46da5ecb131f8d902a0fbd704934f209e1)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Diffstat (limited to 'Python')
-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 18ea576..2795e0f 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 |