Remove memory leak when function call raises an exception.

This commit is contained in:
Anthony Tuininga 2017-01-12 14:09:27 -07:00
parent d4eb90d848
commit 59053718be

View File

@ -1596,8 +1596,10 @@ static PyObject *Cursor_CallFunc(
return NULL;
// call the function
if (Cursor_Call(self, var, name, listOfArguments, keywordArguments) < 0)
if (Cursor_Call(self, var, name, listOfArguments, keywordArguments) < 0) {
Py_DECREF(var);
return NULL;
}
// determine the results
results = Variable_GetValue(var, 0);