summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1999-01-27 23:13:59 (GMT)
committerBarry Warsaw <barry@python.org>1999-01-27 23:13:59 (GMT)
commitf988e687a1f0251c36fe620e5f562c113f338cd9 (patch)
tree811b3c0066449e92cee6bef3c42520e71feb7359 /Python
parent583cc31c223de8f021db7e427876e6097374bc9e (diff)
downloadcpython-f988e687a1f0251c36fe620e5f562c113f338cd9.zip
cpython-f988e687a1f0251c36fe620e5f562c113f338cd9.tar.gz
cpython-f988e687a1f0251c36fe620e5f562c113f338cd9.tar.bz2
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.
Diffstat (limited to 'Python')
-rw-r--r--Python/bltinmodule.c1
1 files changed, 1 insertions, 0 deletions
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;