]> xenbits.xensource.com Git - people/dariof/libvirt.git/commitdiff
qemumonitortestutils: Don't skip va_end() on error path
authorPeter Krempa <pkrempa@redhat.com>
Thu, 1 Aug 2013 14:33:23 +0000 (16:33 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 2 Aug 2013 10:28:58 +0000 (12:28 +0200)
When allocation of memory failed the error path didn't call va_end()
causing a coverity failure.

Reported by John Ferlan.

tests/qemumonitortestutils.c

index fb76156a57243765139da914e8e54a6bfaa4dc74..5697946459b590c20642547d3a5b050a8d9c53fb 100644 (file)
@@ -669,7 +669,7 @@ qemuMonitorTestAddItemParams(qemuMonitorTestPtr test,
     va_start(args, response);
 
     if (VIR_ALLOC(data) < 0)
-        return -1;
+        goto error;
 
     if (VIR_STRDUP(data->command_name, cmdname) < 0 ||
         VIR_STRDUP(data->response, response) < 0)