summaryrefslogtreecommitdiffstats
path: root/Objects/codeobject.c
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2016-11-09 14:42:14 (GMT)
committerYury Selivanov <yury@magic.io>2016-11-09 14:42:14 (GMT)
commitd2fd3599abeed393ccdf4ee5cf1c7b346ba4a022 (patch)
tree396e99bdb5e58ca4b353aa640b51ed7b1a9bb2c0 /Objects/codeobject.c
parent58c534dd6cac474776e173fbeb06efbf46aff028 (diff)
downloadcpython-d2fd3599abeed393ccdf4ee5cf1c7b346ba4a022.zip
cpython-d2fd3599abeed393ccdf4ee5cf1c7b346ba4a022.tar.gz
cpython-d2fd3599abeed393ccdf4ee5cf1c7b346ba4a022.tar.bz2
ssue #27942: Fix memory leak in codeobject.c
Diffstat (limited to 'Objects/codeobject.c')
-rw-r--r--Objects/codeobject.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Objects/codeobject.c b/Objects/codeobject.c
index 9df87b0..c334626 100644
--- a/Objects/codeobject.c
+++ b/Objects/codeobject.c
@@ -69,6 +69,7 @@ intern_string_constants(PyObject *tuple)
intern_string_constants(v);
}
else if (PyFrozenSet_CheckExact(v)) {
+ PyObject *w = v;
PyObject *tmp = PySequence_Tuple(v);
if (tmp == NULL) {
PyErr_Clear();
@@ -81,6 +82,7 @@ intern_string_constants(PyObject *tuple)
}
else {
PyTuple_SET_ITEM(tuple, i, v);
+ Py_DECREF(w);
modified = 1;
}
}