From: Christian Heimes Date: Thu, 14 Nov 2013 00:39:35 +0000 (+0100) Subject: Issue #17828: va_start() must be accompanied by va_end() X-Git-Tag: v3.4.0b1~287 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=507eabdf11d34cd95cbe44ba876af0a414d7f597;p=thirdparty%2FPython%2Fcpython.git Issue #17828: va_start() must be accompanied by va_end() CID 1128793: Missing varargs init or cleanup (VARARGS) --- diff --git a/Objects/exceptions.c b/Objects/exceptions.c index 53d8b6668a56..2f0d5b6400e6 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -2632,12 +2632,6 @@ _PyErr_TrySetFromCause(const char *format, ...) PyObject *new_exc, *new_val, *new_tb; va_list vargs; -#ifdef HAVE_STDARG_PROTOTYPES - va_start(vargs, format); -#else - va_start(vargs); -#endif - PyErr_Fetch(&exc, &val, &tb); caught_type = (PyTypeObject *) exc; /* Ensure type info indicates no extra state is stored at the C level */ @@ -2690,7 +2684,14 @@ _PyErr_TrySetFromCause(const char *format, ...) * types as well, but that's quite a bit trickier due to the extra * state potentially stored on OSError instances. */ + +#ifdef HAVE_STDARG_PROTOTYPES + va_start(vargs, format); +#else + va_start(vargs); +#endif msg_prefix = PyUnicode_FromFormatV(format, vargs); + va_end(vargs); if (msg_prefix == NULL) return NULL;