summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-08-19 15:58:12 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-08-19 15:58:12 (GMT)
commit6902ddf2cab4900fa01248c313e7d4a7e67d97f7 (patch)
tree3159e9a5b1736200f0fa0b6f60b65cb8f5ce5798
parentd925bd5794e46e0952677ecdd6bf620bcbc719ae (diff)
downloadcpython-6902ddf2cab4900fa01248c313e7d4a7e67d97f7.zip
cpython-6902ddf2cab4900fa01248c313e7d4a7e67d97f7.tar.gz
cpython-6902ddf2cab4900fa01248c313e7d4a7e67d97f7.tar.bz2
Fix a refleak in call_maybe()
Issue #27128. Fix a reference leak if creating the tuple to pass positional parameters fails.
-rw-r--r--Objects/typeobject.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index a78f328..1181d77 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -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);