Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6902ddf

Browse files
committed
Fix a refleak in call_maybe()
Issue #27128. Fix a reference leak if creating the tuple to pass positional parameters fails.
1 parent d925bd5 commit 6902ddf

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Objects/typeobject.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1470,8 +1470,10 @@ call_maybe(PyObject *o, _Py_Identifier *nameid, char *format, ...)
14701470

14711471
va_end(va);
14721472

1473-
if (args == NULL)
1473+
if (args == NULL) {
1474+
Py_DECREF(func);
14741475
return NULL;
1476+
}
14751477

14761478
assert(PyTuple_Check(args));
14771479
retval = PyObject_Call(func, args, NULL);

0 commit comments

Comments
 (0)