diff options
author | Christian Heimes <christian@cheimes.de> | 2012-09-10 00:54:51 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2012-09-10 00:54:51 (GMT) |
commit | 074ebced1b0c43dda6a6fdef8865050d019316a7 (patch) | |
tree | de5f256e931926c12179320d6896160158c65dd0 | |
parent | 8b54d6d73312186b4736cdf69a4e2e46ba15784c (diff) | |
download | cpython-074ebced1b0c43dda6a6fdef8865050d019316a7.zip cpython-074ebced1b0c43dda6a6fdef8865050d019316a7.tar.gz cpython-074ebced1b0c43dda6a6fdef8865050d019316a7.tar.bz2 |
PyTuple_Pack() was missing va_end() in its error branch which lead to a resource leak.
-rw-r--r-- | Objects/tupleobject.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index 3249ccc..00f2e47 100644 --- a/Objects/tupleobject.c +++ b/Objects/tupleobject.c @@ -192,8 +192,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 *); |