From: Andrii Simiklit Date: Thu, 6 Sep 2018 14:43:52 +0000 (+0300) Subject: mesa/util: don't use the same 'va_list' instance twice X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=570cacba7af165175ad40820c5e663db5b1c5066;p=mesa.git mesa/util: don't use the same 'va_list' instance twice The first usage of the 'va_list' instance could change it. Reviewed-by: Eric Engestrom Fixes: 864148d69e1e "util: add util_vasprintf() for Windows (v2)" Signed-off-by: Andrii Simiklit --- diff --git a/src/util/u_string.h b/src/util/u_string.h index ce454308d7b..374c00e0bcb 100644 --- a/src/util/u_string.h +++ b/src/util/u_string.h @@ -119,7 +119,7 @@ util_vasprintf(char **ret, const char *format, va_list ap) /* Compute length of output string first */ va_copy(ap_copy, ap); - int r = util_vsnprintf(NULL, 0, format, ap); + int r = util_vsnprintf(NULL, 0, format, ap_copy); va_end(ap_copy); if (r < 0)