summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2012-09-10 00:54:51 (GMT)
committerChristian Heimes <christian@cheimes.de>2012-09-10 00:54:51 (GMT)
commitd5a88044a3fe666c63db99a2b58561f726728664 (patch)
tree74230a934a9e7e20973beef3971411d09f1be191
parent949f3317312c64425efae21bda86b98423aac9cf (diff)
downloadcpython-d5a88044a3fe666c63db99a2b58561f726728664.zip
cpython-d5a88044a3fe666c63db99a2b58561f726728664.tar.gz
cpython-d5a88044a3fe666c63db99a2b58561f726728664.tar.bz2
PyTuple_Pack() was missing va_end() in its error branch which lead to a resource leak.
-rw-r--r--Objects/tupleobject.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index e99eda0..b345460 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -194,8 +194,10 @@ PyTuple_Pack(Py_ssize_t n, ...)
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 *);