From 047755d5cbe9874a02a837e00bab0db474b27029 Mon Sep 17 00:00:00 2001 From: Yan Yanchii Date: Tue, 9 Jan 2024 08:23:27 +0100 Subject: [PATCH] Add missing error check in `update_symbols` --- Python/symtable.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Python/symtable.c b/Python/symtable.c index 52d5932896b263..83137b491f282c 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -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;