From d5a88044a3fe666c63db99a2b58561f726728664 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Mon, 10 Sep 2012 02:54:51 +0200 Subject: [PATCH] PyTuple_Pack() was missing va_end() in its error branch which lead to a resource leak. --- Objects/tupleobject.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index e99eda06f18..b3454600c9b 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 *);