提交 b15f5883 编写于 作者: P Peter Krempa

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.
上级 104011ea
...@@ -3246,11 +3246,13 @@ qemuMonitorAddObject(qemuMonitorPtr mon, ...@@ -3246,11 +3246,13 @@ qemuMonitorAddObject(qemuMonitorPtr mon,
mon, type, objalias, props); mon, type, objalias, props);
int ret = -1; int ret = -1;
if (mon->json) if (mon->json) {
ret = qemuMonitorJSONAddObject(mon, type, objalias, props); ret = qemuMonitorJSONAddObject(mon, type, objalias, props);
else } else {
virJSONValueFree(props);
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("object adding requires JSON monitor")); _("object adding requires JSON monitor"));
}
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册