提交 9aa24267 编写于 作者: J Ján Tomko

qemumonitorjsontest: use virCPUDefNew()

virCPUDefPtr uses refcounting internally and must be allocated
using virCPUDefNew, otherwise virCPUDefFree would be a no-op.
Signed-off-by: NJán Tomko <jtomko@redhat.com>
Fixes: fa2404bf
Fixes: eee09435Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
上级 01e68455
......@@ -2993,8 +2993,8 @@ testQemuMonitorJSONqemuMonitorJSONGetCPUModelComparison(const void *opaque)
"{\"return\":{\"result\":\"test\"}}") < 0)
return -1;
if (VIR_ALLOC(cpu_a) < 0 || VIR_ALLOC(cpu_b) < 0)
goto cleanup;
cpu_a = virCPUDefNew();
cpu_b = virCPUDefNew();
cpu_a->model = g_strdup("cpu_a");
cpu_b->model = g_strdup("cpu_b");
......@@ -3045,8 +3045,8 @@ testQemuMonitorJSONqemuMonitorJSONGetCPUModelBaseline(const void *opaque)
"}") < 0)
return -1;
if (VIR_ALLOC(cpu_a) < 0 || VIR_ALLOC(cpu_b) < 0)
goto cleanup;
cpu_a = virCPUDefNew();
cpu_b = virCPUDefNew();
cpu_a->model = g_strdup("cpu_a");
cpu_b->model = g_strdup("cpu_b");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册