mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +00:00
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 <jferlan@redhat.com>
This commit is contained in:
parent
947593f6e6
commit
b74a3fb307
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user