From: Victor Stinner Date: Fri, 19 Aug 2016 15:52:53 +0000 (+0200) Subject: Fix a refleak in call_method() X-Git-Tag: v2.7.13rc1~208 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9921d3bdc6717ba221b1338d4d7e2323d5f0bb5;p=thirdparty%2FPython%2Fcpython.git Fix a refleak in call_method() Issue #27128. Fix a reference leak if creating the tuple to pass positional parameters fails. --- diff --git a/Objects/typeobject.c b/Objects/typeobject.c index ee0921ac00ad..00995d481d6a 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -1274,8 +1274,10 @@ call_method(PyObject *o, char *name, PyObject **nameobj, 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);