From: Guido van Rossum Date: Thu, 9 Oct 2003 03:46:35 +0000 (+0000) Subject: Fix leak introduced by previous typeobject.c checkin. X-Git-Tag: v2.4a1~1455 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=22c3dda1e64f413d4f6781d983067d580567071b;p=python Fix leak introduced by previous typeobject.c checkin. --- diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 2708cdce86..cc844ad6dd 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -3569,16 +3569,15 @@ wrap_objobjproc(PyObject *self, PyObject *args, void *wrapped) { objobjproc func = (objobjproc)wrapped; int res; - PyObject *value, *ret; + PyObject *value; if (!PyArg_ParseTuple(args, "O", &value)) return NULL; res = (*func)(self, value); if (res == -1 && PyErr_Occurred()) return NULL; - ret = PyObject_IsTrue(PyInt_FromLong((long)res)) ? Py_True : Py_False; - Py_INCREF(ret); - return ret; + else + return PyBool_FromLong(res); } static PyObject *