Skip to content

Commit c4fe3fe

Browse files
committed
PyTuple_Pack() was missing va_end() in its error branch which lead to a resource leak.
2 parents 110ac16 + d5a8804 commit c4fe3fe

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Objects/tupleobject.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,10 @@ PyTuple_Pack(Py_ssize_t n, ...)
210210

211211
va_start(vargs, n);
212212
result = PyTuple_New(n);
213-
if (result == NULL)
213+
if (result == NULL) {
214+
va_end(vargs);
214215
return NULL;
216+
}
215217
items = ((PyTupleObject *)result)->ob_item;
216218
for (i = 0; i < n; i++) {
217219
o = va_arg(vargs, PyObject *);

0 commit comments

Comments
 (0)