summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2011-08-17 03:26:48 (GMT)
committerBenjamin Peterson <benjamin@python.org>2011-08-17 03:26:48 (GMT)
commitae13c88d8dcfef005556a176d39434da231fd8e1 (patch)
tree377da01a67abfab15389e51e201df33f5a7dfa0e /Objects
parentf6b25b9e357a6324118cb80cf84cd7f84d6fd5f7 (diff)
downloadcpython-ae13c88d8dcfef005556a176d39434da231fd8e1.zip
cpython-ae13c88d8dcfef005556a176d39434da231fd8e1.tar.gz
cpython-ae13c88d8dcfef005556a176d39434da231fd8e1.tar.bz2
fix possible refleaks
Diffstat (limited to 'Objects')
-rw-r--r--Objects/typeobject.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 97a94a7..856a4a5 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++;
}