From 48aa605337a820b476e18896564a5ef877c5b27d Mon Sep 17 00:00:00 2001 From: Yury Selivanov Date: Wed, 9 Nov 2016 09:41:15 -0500 Subject: [PATCH] Issue #27942: Fix memory leak in codeobject.c --- Objects/codeobject.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Objects/codeobject.c b/Objects/codeobject.c index 79ac1b5340f..a66aa6905a9 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; } }