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>
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;
}
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;
}