mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-12 13:17:58 +03:00
qemu: monitor: Sanitize control flow in qemuMonitorSetCapabilities
This commit is contained in:
parent
119aa5d35a
commit
0e9fadd66d
@ -1527,7 +1527,6 @@ qemuMonitorEmitSerialChange(qemuMonitorPtr mon,
|
||||
int
|
||||
qemuMonitorSetCapabilities(qemuMonitorPtr mon)
|
||||
{
|
||||
int ret;
|
||||
VIR_DEBUG("mon=%p", mon);
|
||||
|
||||
if (!mon) {
|
||||
@ -1536,16 +1535,10 @@ qemuMonitorSetCapabilities(qemuMonitorPtr mon)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (mon->json) {
|
||||
ret = qemuMonitorJSONSetCapabilities(mon);
|
||||
if (ret < 0)
|
||||
goto cleanup;
|
||||
} else {
|
||||
ret = 0;
|
||||
}
|
||||
if (!mon->json)
|
||||
return 0;
|
||||
|
||||
cleanup:
|
||||
return ret;
|
||||
return qemuMonitorJSONSetCapabilities(mon);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user