summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2012-09-10 00:55:13 (GMT)
committerChristian Heimes <christian@cheimes.de>2012-09-10 00:55:13 (GMT)
commitc4fe3fed6eddb3cefa917a8dcf86fff0b04df6ee (patch)
treef880aefaa830e9091655b43744ed49e7cce05ca5 /Objects
parent110ac16b9f1be086ba98aa6f1ef8d7105493d92e (diff)
parentd5a88044a3fe666c63db99a2b58561f726728664 (diff)
downloadcpython-c4fe3fed6eddb3cefa917a8dcf86fff0b04df6ee.zip
cpython-c4fe3fed6eddb3cefa917a8dcf86fff0b04df6ee.tar.gz
cpython-c4fe3fed6eddb3cefa917a8dcf86fff0b04df6ee.tar.bz2
PyTuple_Pack() was missing va_end() in its error branch which lead to a resource leak.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/tupleobject.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index 013db69..b76125a 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -210,8 +210,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 *);