From 91372d6dab27b3471f89bbef20534fb0905a3a1a Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 21 Mar 2017 13:38:39 +0200 Subject: [PATCH] [xfer] Ensure va_end() is called on failure path Signed-off-by: Michael Brown --- src/core/xfer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/xfer.c b/src/core/xfer.c index 3a2f174d..0faf3292 100644 --- a/src/core/xfer.c +++ b/src/core/xfer.c @@ -306,11 +306,11 @@ int xfer_vprintf ( struct interface *intf, const char *format, /* Create temporary string */ va_copy ( args_tmp, args ); len = vasprintf ( &buf, format, args ); + va_end ( args_tmp ); if ( len < 0 ) { rc = len; goto err_asprintf; } - va_end ( args_tmp ); /* Transmit string */ if ( ( rc = xfer_deliver_raw ( intf, buf, len ) ) != 0 )