Commits

Christian Heimes committed bbc580e Draft

PyTuple_Pack() was missing va_end() in its error branch which lead to a resource leak.

Comments (0)

Files changed (1)

Objects/tupleobject.c

 
     va_start(vargs, n);
     result = PyTuple_New(n);
-    if (result == NULL)
+    if (result == NULL) {
+        va_end(vargs);
         return NULL;
+    }
     items = ((PyTupleObject *)result)->ob_item;
     for (i = 0; i < n; i++) {
         o = va_arg(vargs, PyObject *);