diff --git a/Python/symtable.c b/Python/symtable.c index 6165cfe162eac0..90b07efa0334cc 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -628,8 +628,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);