Commit 71665dc9 authored by Michael W. Hudson's avatar Michael W. Hudson

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!
parent b2f89ee7
...@@ -947,12 +947,14 @@ int_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds) ...@@ -947,12 +947,14 @@ int_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
if (!PyLong_Check(tmp)) { if (!PyLong_Check(tmp)) {
PyErr_SetString(PyExc_ValueError, PyErr_SetString(PyExc_ValueError,
"value must convertable to an int"); "value must convertable to an int");
Py_DECREF(tmp);
return NULL; return NULL;
} }
ival = PyLong_AsLong(tmp); ival = PyLong_AsLong(tmp);
if (ival == -1 && PyErr_Occurred()) if (ival == -1 && PyErr_Occurred()) {
Py_DECREF(tmp);
return NULL; return NULL;
}
} else { } else {
ival = ((PyIntObject *)tmp)->ob_ival; ival = ((PyIntObject *)tmp)->ob_ival;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment