]> granicus.if.org Git - python/commitdiff
Fix refleak
authorNeal Norwitz <nnorwitz@gmail.com>
Fri, 23 Jun 2006 03:32:44 +0000 (03:32 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Fri, 23 Jun 2006 03:32:44 +0000 (03:32 +0000)
Objects/typeobject.c

index 760ef95858d2b5469f1f9a26445633f920ccb6dc..2046972646efed5e02ae2e4a2417e106ae1483a0 100644 (file)
@@ -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();