From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:34260) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJiAz-0000kZ-Nm for qemu-devel@nongnu.org; Fri, 28 Oct 2011 04:52:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RJiAy-0002e5-Lb for qemu-devel@nongnu.org; Fri, 28 Oct 2011 04:52:33 -0400 From: Markus Armbruster Date: Fri, 28 Oct 2011 10:52:26 +0200 Message-Id: <1319791946-15602-3-git-send-email-armbru@redhat.com> In-Reply-To: <1319791946-15602-1-git-send-email-armbru@redhat.com> References: <1319791946-15602-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH 2/2] hw/9pfs: Supply missing va_end() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, jvrao@linux.vnet.ibm.com 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 --- 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