提交 b74a3fb3 编写于 作者: J John Ferlan

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: NJohn Ferlan <jferlan@redhat.com>
上级 947593f6
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册