Skip to content

Commit fc439d2

Browse files
ZackerySpytzserhiy-storchaka
authored andcommitted
Fix a possible decref of a borrowed reference in symtable.c. (GH-9786)
1 parent 9b8c2e7 commit fc439d2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Python/symtable.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -625,8 +625,10 @@ update_symbols(PyObject *symbols, PyObject *scopes,
625625
return 0;
626626

627627
itr = PyObject_GetIter(free);
628-
if (!itr)
629-
goto error;
628+
if (itr == NULL) {
629+
Py_DECREF(v_free);
630+
return 0;
631+
}
630632

631633
while ((name = PyIter_Next(itr))) {
632634
v = PyDict_GetItem(symbols, name);

0 commit comments

Comments
 (0)