From: John Ferlan Date: Thu, 4 Sep 2014 21:15:51 +0000 (-0400) Subject: qemu: Resolve Coverity NEGATIVE_RETURNS X-Git-Tag: CVE-2014-3633~86 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b74a3fb307f5e3743bba846956bddab1002b55c9;p=thirdparty%2Flibvirt.git qemu: Resolve Coverity NEGATIVE_RETURNS 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 --- diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 854a9b86da..a652f29db8 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -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;