SF patch 703666: Several objects don't decref tmp on failure in subtype_new
Submitted By: Christopher A. Craig
Fillin some missing decrefs.
diff --git a/Objects/longobject.c b/Objects/longobject.c
index 52c30c2..f246bd2 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -2794,8 +2794,10 @@
if (n < 0)
n = -n;
new = (PyLongObject *)type->tp_alloc(type, n);
- if (new == NULL)
+ if (new == NULL) {
+ Py_DECREF(tmp);
return NULL;
+ }
assert(PyLong_Check(new));
new->ob_size = tmp->ob_size;
for (i = 0; i < n; i++)