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

xen_xl.c: Use g_autoptr() for virCPUDef

In xenParseXLVnuma() the @cpu variable is freed explicitly.
However, when switched to g_autoptr(virCPUDef) the explicit call
can be removed.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Michal Privoznik 2022-01-14 09:37:29 +01:00
parent ef7f01b6d0
commit d90cb8ff10

View File

@ -396,7 +396,7 @@ xenParseXLVnuma(virConf *conf,
size_t vcpus = 0;
size_t nr_nodes = 0;
size_t vnodeCnt = 0;
virCPUDef *cpu = NULL;
g_autoptr(virCPUDef) cpu = NULL;
virConfValue *list;
virConfValue *vnode;
virDomainNuma *numa;
@ -529,14 +529,11 @@ xenParseXLVnuma(virConf *conf,
}
cpu->type = VIR_CPU_TYPE_GUEST;
def->cpu = cpu;
def->cpu = g_steal_pointer(&cpu);
ret = 0;
cleanup:
if (ret)
VIR_FREE(cpu);
return ret;
}