mesa/util: add missing va_end() after va_copy()
authorAndrii Simiklit <andrii.simiklit@globallogic.com>
Thu, 6 Sep 2018 14:43:54 +0000 (17:43 +0300)
committerEric Engestrom <eric.engestrom@intel.com>
Thu, 6 Sep 2018 16:33:27 +0000 (17:33 +0100)
MSDN:
"va_end must be called on each argument list that's initialized
 with va_start or va_copy before the function returns."

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107810
Fixes: c6267ebd6c8a "gallium/util: Stop bundling our snprintf implementation."
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
src/util/u_string.h

index fb43ed0afc31623e0bbc61fc793af0f2bef0cce1..e4081466459cb5f7902bf7f60c4e76a36279d368 100644 (file)
@@ -81,6 +81,7 @@ util_vsnprintf(char *str, size_t size, const char *format, va_list ap)
    if (ret < 0) {
       ret = _vscprintf(format, ap_copy);
    }
+   va_end(ap_copy);
    return ret;
 }