qemu: monitor: Sanitize control flow in qemuMonitorSetCapabilities

This commit is contained in:
Peter Krempa 2015-04-14 15:17:10 +02:00
parent 119aa5d35a
commit 0e9fadd66d
1 changed files with 3 additions and 10 deletions

View File

@ -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);
}