Commit d925bd57 authored by Victor Stinner's avatar Victor Stinner

Fix a refleak in call_method()

Issue #27128. Fix a reference leak if creating the tuple to pass positional
parameters fails.
parent 53926f19
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment