summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2018-10-11 05:05:35 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2018-10-11 05:05:35 (GMT)
commitfc439d20de32b0ebccca79a96e31f83b85ec4eaf (patch)
tree3eff47cab7bf0298b65ea679cf9014e50a16df44
parent9b8c2e767643256202bb11456ba8665593b9a500 (diff)
downloadcpython-fc439d20de32b0ebccca79a96e31f83b85ec4eaf.zip
cpython-fc439d20de32b0ebccca79a96e31f83b85ec4eaf.tar.gz
cpython-fc439d20de32b0ebccca79a96e31f83b85ec4eaf.tar.bz2
Fix a possible decref of a borrowed reference in symtable.c. (GH-9786)
-rw-r--r--Python/symtable.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Python/symtable.c b/Python/symtable.c
index 16b706b..d74f26f 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -625,8 +625,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);