]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[xfer] Ensure va_end() is called on failure path
authorMichael Brown <mcb30@ipxe.org>
Tue, 21 Mar 2017 11:38:39 +0000 (13:38 +0200)
committerMichael Brown <mcb30@ipxe.org>
Tue, 21 Mar 2017 11:38:39 +0000 (13:38 +0200)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/core/xfer.c

index 3a2f174d062931a7971b20c029c18bb28d2041e2..0faf3292aa63ae88d0ae908efde28bae1ef68a5f 100644 (file)
@@ -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 )