Fix a refleak in call_method()

Issue #27128. Fix a reference leak if creating the tuple to pass positional
parameters fails.
This commit is contained in:
Victor Stinner 2016-08-19 17:51:49 +02:00
parent 53926f19cd
commit d925bd5794
1 changed files with 3 additions and 1 deletions

View File

@ -1432,8 +1432,10 @@ call_method(PyObject *o, _Py_Identifier *nameid, char *format, ...)
va_end(va);
if (args == NULL)
if (args == NULL) {
Py_DECREF(func);
return NULL;
}
assert(PyTuple_Check(args));
retval = PyObject_Call(func, args, NULL);