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!
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;
}