diff options
author | Michael W. Hudson <mwh@python.net> | 2003-08-11 17:32:02 (GMT) |
---|---|---|
committer | Michael W. Hudson <mwh@python.net> | 2003-08-11 17:32:02 (GMT) |
commit | 71665dc90d6bc79be710e2a6bea5dba417b2dcb3 (patch) | |
tree | de0904f3123d8db9ff901a8add60f3d65b4c0832 /Objects | |
parent | b2f89ee71a494b3b1aaaeef42d2b43bcf50735cd (diff) | |
download | cpython-71665dc90d6bc79be710e2a6bea5dba417b2dcb3.zip cpython-71665dc90d6bc79be710e2a6bea5dba417b2dcb3.tar.gz cpython-71665dc90d6bc79be710e2a6bea5dba417b2dcb3.tar.bz2 |
Add a couple of decrefs to error paths.
Now test_descr only appears to leak two references & I think this
are in fact illusory (it's to do with things getting resurrected in
__del__ methods & it's easy to be believe confusion occurs when that
happens <wink>). Woohoo!
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/intobject.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Objects/intobject.c b/Objects/intobject.c index a3df3ba..b97e2bc 100644 --- a/Objects/intobject.c +++ b/Objects/intobject.c @@ -947,12 +947,14 @@ int_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds) if (!PyLong_Check(tmp)) { PyErr_SetString(PyExc_ValueError, "value must convertable to an int"); + Py_DECREF(tmp); return NULL; } ival = PyLong_AsLong(tmp); - if (ival == -1 && PyErr_Occurred()) + if (ival == -1 && PyErr_Occurred()) { + Py_DECREF(tmp); return NULL; - + } } else { ival = ((PyIntObject *)tmp)->ob_ival; } |