From: Benjamin Peterson Date: Wed, 17 Aug 2011 03:26:48 +0000 (-0500) Subject: fix possible refleaks X-Git-Tag: v3.2.3rc1~649 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ae13c88d8dcfef005556a176d39434da231fd8e1;p=thirdparty%2FPython%2Fcpython.git fix possible refleaks --- diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 97a94a764098..856a4a5f386d 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -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++; }