From: Barry Warsaw Date: Wed, 27 Jan 1999 23:13:59 +0000 (+0000) Subject: builtin_complex(): Nailed memory leak. This one's in the instance X-Git-Tag: v1.5.2b2~249 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f988e687a1f0251c36fe620e5f562c113f338cd9;p=thirdparty%2FPython%2Fcpython.git builtin_complex(): Nailed memory leak. This one's in the instance test for classes with a __complex__() method. The attribute is pulled out of the instance with PyObject_GetAttr() but this transfers ownership and the function object was never DECREF'd. --- diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index d23026182e5d..df6b98b42c40 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -409,6 +409,7 @@ builtin_complex(self, args) return NULL; r = PyEval_CallObject(f, args); Py_DECREF(args); + Py_DECREF(f); if (r == NULL) return NULL; own_r = 1;