[Python-checkins] cpython (2.7): PyTuple_Pack() was missing va_end() in its error branch which lead to a

christian.heimes python-checkins at python.org
Mon Sep 10 02:55:51 CEST 2012


http://hg.python.org/cpython/rev/bb0390c1d3d4
changeset:   78939:bb0390c1d3d4
branch:      2.7
parent:      78931:27837a33790d
user:        Christian Heimes <christian at cheimes.de>
date:        Mon Sep 10 02:54:51 2012 +0200
summary:
  PyTuple_Pack() was missing va_end() in its error branch which lead to a resource leak.

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


diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -192,8 +192,10 @@
 
     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 *);

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


More information about the Python-checkins mailing list