freedreno: Add missing va_end.
authorVinson Lee <vlee@freedesktop.org>
Tue, 26 May 2020 23:09:03 +0000 (16:09 -0700)
committerMarge Bot <eric+marge@anholt.net>
Wed, 27 May 2020 00:12:38 +0000 (00:12 +0000)
Fix warning reported by Coverity Scan.

Missing varargs init or cleanup (VARARGS)
missing_va_end: va_end was not called for ap.

Fixes: a0ca1462f317 ("freedreno: add logging infrastructure")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5221>

src/gallium/drivers/freedreno/freedreno_log.c

index 8970e40189eb99e2c27db59a340d1ef191b48e48..ad4c49eb2ec40919720cdb5859fa6057e6e76da5 100644 (file)
@@ -215,8 +215,10 @@ _fd_log(struct fd_batch *batch, const char *fmt, ...)
 
        va_list ap;
        va_start(ap, fmt);
-       if (vasprintf(&msg, fmt, ap) < 0)
+       if (vasprintf(&msg, fmt, ap) < 0) {
+               va_end(ap);
                return;
+       }
        va_end(ap);
 
        u_fifo_add(chunk->msg_fifo, msg);