mirror of https://github.com/python/cpython
PyTuple_Pack() was missing va_end() in its error branch which lead to a resource leak.
This commit is contained in:
commit
c4fe3fed6e
|
@ -210,8 +210,10 @@ PyTuple_Pack(Py_ssize_t n, ...)
|
||||||
|
|
||||||
va_start(vargs, n);
|
va_start(vargs, n);
|
||||||
result = PyTuple_New(n);
|
result = PyTuple_New(n);
|
||||||
if (result == NULL)
|
if (result == NULL) {
|
||||||
|
va_end(vargs);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
items = ((PyTupleObject *)result)->ob_item;
|
items = ((PyTupleObject *)result)->ob_item;
|
||||||
for (i = 0; i < n; i++) {
|
for (i = 0; i < n; i++) {
|
||||||
o = va_arg(vargs, PyObject *);
|
o = va_arg(vargs, PyObject *);
|
||||||
|
|
Loading…
Reference in New Issue