PyTuple_Pack() was missing va_end() in its error branch which lead to a resource leak.

This commit is contained in:
Christian Heimes 2012-09-10 02:54:51 +02:00
parent 8b54d6d733
commit 074ebced1b
1 changed files with 3 additions and 1 deletions

View File

@ -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 *);