mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-20 04:59:49 +00:00
cpu_x86: Use g_auto* in virCPUx86LoadMap
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
b239a60967
commit
3c650a8f7a
@ -1559,18 +1559,14 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUx86Map, x86MapFree);
|
|||||||
static virCPUx86MapPtr
|
static virCPUx86MapPtr
|
||||||
virCPUx86LoadMap(void)
|
virCPUx86LoadMap(void)
|
||||||
{
|
{
|
||||||
virCPUx86MapPtr map;
|
g_autoptr(virCPUx86Map) map = NULL;
|
||||||
|
|
||||||
map = g_new0(virCPUx86Map, 1);
|
map = g_new0(virCPUx86Map, 1);
|
||||||
|
|
||||||
if (cpuMapLoad("x86", x86VendorParse, x86FeatureParse, x86ModelParse, map) < 0)
|
if (cpuMapLoad("x86", x86VendorParse, x86FeatureParse, x86ModelParse, map) < 0)
|
||||||
goto error;
|
return NULL;
|
||||||
|
|
||||||
return map;
|
return g_steal_pointer(&map);
|
||||||
|
|
||||||
error:
|
|
||||||
x86MapFree(map);
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user