mirror of
https://github.com/python/cpython.git
synced 2025-11-26 13:22:51 +00:00
Fix a refleak in call_maybe()
Issue #27128. Fix a reference leak if creating the tuple to pass positional parameters fails.
This commit is contained in:
parent
d925bd5794
commit
6902ddf2ca
1 changed files with 3 additions and 1 deletions
|
|
@ -1470,8 +1470,10 @@ call_maybe(PyObject *o, _Py_Identifier *nameid, char *format, ...)
|
||||||
|
|
||||||
va_end(va);
|
va_end(va);
|
||||||
|
|
||||||
if (args == NULL)
|
if (args == NULL) {
|
||||||
|
Py_DECREF(func);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
assert(PyTuple_Check(args));
|
assert(PyTuple_Check(args));
|
||||||
retval = PyObject_Call(func, args, NULL);
|
retval = PyObject_Call(func, args, NULL);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue