summaryrefslogtreecommitdiffstats
path: root/Objects/longobject.c
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2003-06-28 20:04:25 (GMT)
committerRaymond Hettinger <python@rcn.com>2003-06-28 20:04:25 (GMT)
commitf466793fcc6e2234f4843bd6a04625f1fac96132 (patch)
tree63ffd3139c3298e98551826ab9b7e41d4be9d536 /Objects/longobject.c
parent6891cd3aa37ac3d27de5563849ef848eed1fe411 (diff)
downloadcpython-f466793fcc6e2234f4843bd6a04625f1fac96132.zip
cpython-f466793fcc6e2234f4843bd6a04625f1fac96132.tar.gz
cpython-f466793fcc6e2234f4843bd6a04625f1fac96132.tar.bz2
SF patch 703666: Several objects don't decref tmp on failure in subtype_new
Submitted By: Christopher A. Craig Fillin some missing decrefs.
Diffstat (limited to 'Objects/longobject.c')
-rw-r--r--Objects/longobject.c4
1 files changed, 3 insertions, 1 deletions
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 @@ long_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
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++)