Commit 6902ddf2 authored by Victor Stinner's avatar Victor Stinner

Fix a refleak in call_maybe()

Issue #27128. Fix a reference leak if creating the tuple to pass positional
parameters fails.
parent d925bd57
......@@ -1470,8 +1470,10 @@ call_maybe(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