1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

qemu: monitor: Don't leak @props with non-JSON in qemuMonitorAddObject

The function comment states that @props is always consumed, even on
failure. This was not true with the failure if the monitor is not using
QMP.
This commit is contained in:
Peter Krempa 2015-03-16 15:25:58 +01:00
parent 104011ea8b
commit b15f588385

View File

@ -3246,11 +3246,13 @@ qemuMonitorAddObject(qemuMonitorPtr mon,
mon, type, objalias, props);
int ret = -1;
if (mon->json)
if (mon->json) {
ret = qemuMonitorJSONAddObject(mon, type, objalias, props);
else
} else {
virJSONValueFree(props);
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("object adding requires JSON monitor"));
}
return ret;
}