summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-08-19 17:52:08 +0200
committerVictor Stinner <victor.stinner@gmail.com>2016-08-19 17:52:08 +0200
commit59e9ca6bdab845a2a2ac3f8c58a4e8ba8e239440 (patch)
treed2bef2e192832f3831c3b73e775319d87835c408
parenta7720f61aa8f94371e940d498be4c2cf8804f36f (diff)
parentd925bd5794e46e0952677ecdd6bf620bcbc719ae (diff)
downloadcpython-git-59e9ca6bdab845a2a2ac3f8c58a4e8ba8e239440.tar.gz
Merge 3.5 (fix refleak in call_method)
-rw-r--r--Objects/typeobject.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index a190e7ae43..9d77a5d7cc 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -1442,8 +1442,10 @@ call_method(PyObject *o, _Py_Identifier *nameid, const 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);