summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2016-11-09 14:41:15 (GMT)
committerYury Selivanov <yury@magic.io>2016-11-09 14:41:15 (GMT)
commit48aa605337a820b476e18896564a5ef877c5b27d (patch)
tree2f2ef03e6a66335461f7f3045ceda62359864bdc
parenta8760275bd59fb8d8be1f1bf05313fed31c08321 (diff)
downloadcpython-48aa605337a820b476e18896564a5ef877c5b27d.zip
cpython-48aa605337a820b476e18896564a5ef877c5b27d.tar.gz
cpython-48aa605337a820b476e18896564a5ef877c5b27d.tar.bz2
Issue #27942: Fix memory leak in 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 79ac1b5..a66aa69 100644
--- a/Objects/codeobject.c
+++ b/Objects/codeobject.c
@@ -65,6 +65,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();
@@ -77,6 +78,7 @@ intern_string_constants(PyObject *tuple)
}
else {
PyTuple_SET_ITEM(tuple, i, v);
+ Py_DECREF(w);
modified = 1;
}
}