]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
fix possible refleaks
authorBenjamin Peterson <benjamin@python.org>
Wed, 17 Aug 2011 03:26:48 +0000 (22:26 -0500)
committerBenjamin Peterson <benjamin@python.org>
Wed, 17 Aug 2011 03:26:48 +0000 (22:26 -0500)
Objects/typeobject.c

index 97a94a764098e34e7d3a5b4235b03b761eb265b9..856a4a5f386dd2368a2f78bc347fa8ba041b10b3 100644 (file)
@@ -2093,8 +2093,10 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
                  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++;
         }