From: Neal Norwitz Date: Fri, 23 Jun 2006 03:32:44 +0000 (+0000) Subject: Fix refleak X-Git-Tag: v2.5b2~129 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b114984225c0371a21ce44e037abb452e36e2a6d;p=thirdparty%2FPython%2Fcpython.git Fix refleak --- diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 760ef95858d2..2046972646ef 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -4595,8 +4595,10 @@ slot_tp_call(PyObject *self, PyObject *args, PyObject *kwds) the object returned for __call__ has __call__ itself defined upon it. This can be an infinite recursion if you set __call__ in a class to an instance of it. */ - if (Py_EnterRecursiveCall(" in __call__")) + if (Py_EnterRecursiveCall(" in __call__")) { + Py_DECREF(meth); return NULL; + } res = PyObject_Call(meth, args, kwds); Py_LeaveRecursiveCall();