[Python-checkins] cpython (merge 3.5 -> default): Merge 3.5 (fix refleak in call_method)

victor.stinner python-checkins at python.org
Fri Aug 19 12:00:09 EDT 2016


https://hg.python.org/cpython/rev/beb261f996b7
changeset:   102766:beb261f996b7
parent:      102764:2da6dc1c30d8
parent:      102765:2d4d40da2aba
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Fri Aug 19 17:52:08 2016 +0200
summary:
  Merge 3.5 (fix refleak in call_method)

files:
  Objects/typeobject.c |  4 +++-
  1 files changed, 3 insertions(+), 1 deletions(-)


diff --git a/Objects/typeobject.c b/Objects/typeobject.c
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -1442,8 +1442,10 @@
 
     va_end(va);
 
-    if (args == NULL)
+    if (args == NULL) {
+        Py_DECREF(func);
         return NULL;
+    }
 
     assert(PyTuple_Check(args));
     retval = PyObject_Call(func, args, NULL);

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list