gh-113842: Add missing error check for PyIter_Next() in Python/symtable.c (GH-113843)

This commit is contained in:
Yan Yanchii
2024-01-09 11:43:58 +01:00
committed by GitHub
parent 2e17cad2b8
commit fda901a1ff

View File

@@ -977,6 +977,12 @@ update_symbols(PyObject *symbols, PyObject *scopes,
}
Py_DECREF(name);
}
/* Check if loop ended because of exception in PyIter_Next */
if (PyErr_Occurred()) {
goto error;
}
Py_DECREF(itr);
Py_DECREF(v_free);
return 1;