Skip to content

Commit

Permalink
Fix a possible decref of a borrowed reference in symtable.c. (GH-9786)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZackerySpytz authored and serhiy-storchaka committed Oct 11, 2018
1 parent 9b8c2e7 commit fc439d2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Python/symtable.c
Expand Up @@ -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);
Expand Down

0 comments on commit fc439d2

Please sign in to comment.