mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
qemumonitorjsontest: GetCPUModelBaseline: use g_auto
Use g_autoptr for the virCPUDef variables. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
4bc5a32e6f
commit
181a945fd8
@ -3014,8 +3014,8 @@ testQemuMonitorJSONqemuMonitorJSONGetCPUModelBaseline(const void *opaque)
|
||||
{
|
||||
const testGenericData *data = opaque;
|
||||
g_autoptr(qemuMonitorTest) test = NULL;
|
||||
virCPUDefPtr cpu_a;
|
||||
virCPUDefPtr cpu_b = NULL;
|
||||
g_autoptr(virCPUDef) cpu_a = virCPUDefNew();
|
||||
g_autoptr(virCPUDef) cpu_b = virCPUDefNew();
|
||||
qemuMonitorCPUModelInfoPtr baseline = NULL;
|
||||
int ret = -1;
|
||||
|
||||
@ -3036,9 +3036,6 @@ testQemuMonitorJSONqemuMonitorJSONGetCPUModelBaseline(const void *opaque)
|
||||
"}") < 0)
|
||||
return -1;
|
||||
|
||||
cpu_a = virCPUDefNew();
|
||||
cpu_b = virCPUDefNew();
|
||||
|
||||
cpu_a->model = g_strdup("cpu_a");
|
||||
cpu_b->model = g_strdup("cpu_b");
|
||||
|
||||
@ -3078,8 +3075,6 @@ testQemuMonitorJSONqemuMonitorJSONGetCPUModelBaseline(const void *opaque)
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
virCPUDefFree(cpu_a);
|
||||
virCPUDefFree(cpu_b);
|
||||
qemuMonitorCPUModelInfoFree(baseline);
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user