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

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


https://hg.python.org/cpython/rev/14fa255ea5ff
changeset:   102770:14fa255ea5ff
parent:      102768:2e6ca74ebc05
parent:      102769:df4efc23ab18
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Fri Aug 19 17:58:30 2016 +0200
summary:
  Merge 3.5 (fix refleak in call_maybe())

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
@@ -1480,8 +1480,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