[v4,4/8] mesa/util: add missing va_end() after va_copy()

Submitted by andrey simiklit on Sept. 6, 2018, 2:43 p.m.

Details

Message ID 1536245039-22231-5-git-send-email-asimiklit.work@gmail.com
State New
Headers show
Series "mesa/util: add missing va_end() after va_copy()" ( rev: 7 ) in Mesa

Not browsing as part of any series.

Commit Message

andrey simiklit Sept. 6, 2018, 2:43 p.m.
From: Andrii Simiklit <andrii.simiklit@globallogic.com>

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 | 1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

diff --git a/src/util/u_string.h b/src/util/u_string.h
index fb43ed0..e408146 100644
--- a/src/util/u_string.h
+++ b/src/util/u_string.h
@@ -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;
 }