diff options
| author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-08-26 08:49:44 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-26 08:49:44 -0700 |
| commit | ed8af33cce5554545d2bd079b23fe551d26fb4bd (patch) | |
| tree | e6f24d1a0bd9862fc8b899bd9f32e033d6f17371 | |
| parent | 82f4bfdbb053eea1c67159b2d73717a21eb89893 (diff) | |
| download | cpython-git-ed8af33cce5554545d2bd079b23fe551d26fb4bd.tar.gz | |
bpo-37954: Fix reference leak in the symtable (GH-15514)
(cherry picked from commit 4901dc46da5ecb131f8d902a0fbd704934f209e1)
Co-authored-by: Pablo Galindo <Pablogsal@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 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 |
