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.
This commit is contained in:
Barry Warsaw 1999-01-27 23:13:59 +00:00
parent 583cc31c22
commit f988e687a1
1 changed files with 1 additions and 0 deletions

View File

@ -409,6 +409,7 @@ builtin_complex(self, args)
return NULL; return NULL;
r = PyEval_CallObject(f, args); r = PyEval_CallObject(f, args);
Py_DECREF(args); Py_DECREF(args);
Py_DECREF(f);
if (r == NULL) if (r == NULL)
return NULL; return NULL;
own_r = 1; own_r = 1;