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:
parent
583cc31c22
commit
f988e687a1
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue