[Python-checkins] cpython (3.2): PyTuple_Pack() was missing va_end() in its error branch which lead to a

christian.heimes python-checkins at python.org
Mon Sep 10 02:55:48 CEST 2012


http://hg.python.org/cpython/rev/bbc580e004d7
changeset: 78937:bbc580e004d7
branch: 3.2
parent: 78934:dcddbd41f08b
user: Christian Heimes <christian at cheimes.de>
date: Mon Sep 10 02:54:51 2012 +0200
summary:
 PyTuple_Pack() was missing va_end() in its error branch which lead to a resource leak.
files:
 Objects/tupleobject.c | 4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -194,8 +194,10 @@
 
 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 *);
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /