diff options
| author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2018-10-11 05:24:14 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-11 05:24:14 (GMT) |
| commit | 1c2cb516e49ceb56f76e90645e67e8df4e5df01a (patch) | |
| tree | d0fde66d720961d2a99f9f9765ac32fe0af64b5c /Python | |
| parent | 8b040e55395b37bdb8fd4ec85a270cfc9ec95307 (diff) | |
| download | cpython-1c2cb516e49ceb56f76e90645e67e8df4e5df01a.zip cpython-1c2cb516e49ceb56f76e90645e67e8df4e5df01a.tar.gz cpython-1c2cb516e49ceb56f76e90645e67e8df4e5df01a.tar.bz2 | |
Fix a possible decref of a borrowed reference in symtable.c. (GH-9786)
(cherry picked from commit fc439d20de32b0ebccca79a96e31f83b85ec4eaf)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Diffstat (limited to 'Python')
| -rw-r--r-- | Python/symtable.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Python/symtable.c b/Python/symtable.c index 1c328a9..81eea95 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -625,8 +625,10 @@ update_symbols(PyObject *symbols, PyObject *scopes, return 0; itr = PyObject_GetIter(free); - if (!itr) - goto error; + if (itr == NULL) { + Py_DECREF(v_free); + return 0; + } while ((name = PyIter_Next(itr))) { v = PyDict_GetItem(symbols, name); |
