qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-trivial] [PATCH 2/2] hw/9pfs: Supply missing va_end()


From: Markus Armbruster
Subject: [Qemu-trivial] [PATCH 2/2] hw/9pfs: Supply missing va_end()
Date: Fri, 28 Oct 2011 10:52:26 +0200

C99 7.15.1: Each invocation of the va_start and va_copy macros shall
be matched by a corresponding invocation of the va_end macro in the
same function.

Spotted by Coverity.  Harmless on the (common) systems where va_end()
does nothing.

Signed-off-by: Markus Armbruster <address@hidden>
---
 hw/9pfs/virtio-9p.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c
index aab3beb..1e22696 100644
--- a/hw/9pfs/virtio-9p.c
+++ b/hw/9pfs/virtio-9p.c
@@ -231,6 +231,7 @@ v9fs_string_alloc_printf(char **strp, const char *fmt, 
va_list ap)
                 arg_ulong = va_arg(ap2, unsigned long);
                 len += number_to_string((void *)&arg_ulong, 'U');
             } else {
+                va_end(ap2);
                 return -1;
             }
             break;
@@ -244,11 +245,14 @@ v9fs_string_alloc_printf(char **strp, const char *fmt, 
va_list ap)
         default:
             fprintf(stderr,
                    "v9fs_string_alloc_printf:Incorrect format %c", *iter);
+            va_end(ap2);
             return -1;
         }
         iter++;
     }
 
+    va_end(ap2);
+
 alloc_print:
     *strp = g_malloc((len + 1) * sizeof(**strp));
 
-- 
1.7.6.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]