[Python-checkins] cpython (3.2): fix possible refleaks

benjamin.peterson python-checkins at python.org
Wed Aug 17 05:28:35 CEST 2011


http://hg.python.org/cpython/rev/f0515cc7ee20
changeset:   71889:f0515cc7ee20
branch:      3.2
parent:      71883:16a02530fd81
user:        Benjamin Peterson <benjamin at python.org>
date:        Tue Aug 16 22:26:48 2011 -0500
summary:
  fix possible refleaks

files:
  Objects/typeobject.c |  4 +++-
  1 files changed, 3 insertions(+), 1 deletions(-)


diff --git a/Objects/typeobject.c b/Objects/typeobject.c
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -2093,8 +2093,10 @@
                  PyUnicode_CompareWithASCIIString(tmp, "__weakref__") == 0))
                 continue;
             tmp =_Py_Mangle(name, tmp);
-            if (!tmp)
+            if (!tmp) {
+                Py_DECREF(newslots);
                 goto bad_slots;
+            }
             PyList_SET_ITEM(newslots, j, tmp);
             j++;
         }

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


More information about the Python-checkins mailing list