summaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/src/Python/symtable.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/tools/python3/src/Python/symtable.c')
-rw-r--r--contrib/tools/python3/src/Python/symtable.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/contrib/tools/python3/src/Python/symtable.c b/contrib/tools/python3/src/Python/symtable.c
index 37e5c697405..3519f620984 100644
--- a/contrib/tools/python3/src/Python/symtable.c
+++ b/contrib/tools/python3/src/Python/symtable.c
@@ -728,6 +728,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;