From f988e687a1f0251c36fe620e5f562c113f338cd9 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Wed, 27 Jan 1999 23:13:59 +0000 Subject: 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. --- Python/bltinmodule.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index d230261..df6b98b 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; -- cgit v0.12