[Python-checkins] cpython (merge 3.6 -> default): Merge 3.6 (issue #27942)

yury.selivanov python-checkins at python.org
Wed Nov 9 09:43:44 EST 2016


https://hg.python.org/cpython/rev/c27269c0d619
changeset:   105012:c27269c0d619
parent:      105008:b78574cb00ab
parent:      105011:b671ac7ae620
user:        Yury Selivanov <yury at magic.io>
date:        Wed Nov 09 09:43:37 2016 -0500
summary:
  Merge 3.6 (issue #27942)

files:
  Misc/NEWS            |  2 ++
  Objects/codeobject.c |  2 ++
  2 files changed, 4 insertions(+), 0 deletions(-)


diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -588,6 +588,8 @@
 
 - Issue #28008: Implement PEP 530 -- asynchronous comprehensions.
 
+- Issue #27942: Fix memory leak in codeobject.c
+
 Library
 -------
 
diff --git a/Objects/codeobject.c b/Objects/codeobject.c
--- a/Objects/codeobject.c
+++ b/Objects/codeobject.c
@@ -77,6 +77,7 @@
             intern_string_constants(v);
         }
         else if (PyFrozenSet_CheckExact(v)) {
+            PyObject *w = v;
             PyObject *tmp = PySequence_Tuple(v);
             if (tmp == NULL) {
                 PyErr_Clear();
@@ -89,6 +90,7 @@
                 }
                 else {
                     PyTuple_SET_ITEM(tuple, i, v);
+                    Py_DECREF(w);
                     modified = 1;
                 }
             }

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list