virCPUDefPtr uses refcounting internally and must be allocated
using virCPUDefNew, otherwise virCPUDefFree would be a no-op.
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Fixes: fa2404bf4f91813431beb797fc30a1237a743823
Fixes: eee09435eec46553aac4fdf1c2d8f3214167bded
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
"{\"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");
"}") < 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");