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:
parent
53926f19cd
commit
d925bd5794
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue