]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Resolve Coverity NEGATIVE_RETURNS
authorJohn Ferlan <jferlan@redhat.com>
Thu, 4 Sep 2014 21:15:51 +0000 (17:15 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 11 Sep 2014 12:10:14 +0000 (08:10 -0400)
Coverity notes that if qemuMonitorGetMachines() returns a negative
nmachines value, then the code at the cleanup label will have issues.

Signed-off-by: John Ferlan <jferlan@redhat.com>
src/qemu/qemu_capabilities.c

index 854a9b86da3cc01a88b9b50af5f8430b36ff3d2b..a652f29db8045ca5316e81747c8033ec1da7adad 100644 (file)
@@ -2285,7 +2285,7 @@ virQEMUCapsProbeQMPMachineTypes(virQEMUCapsPtr qemuCaps,
     size_t defIdx = 0;
 
     if ((nmachines = qemuMonitorGetMachines(mon, &machines)) < 0)
-        goto cleanup;
+        return -1;
 
     if (VIR_ALLOC_N(qemuCaps->machineTypes, nmachines) < 0)
         goto cleanup;