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:
Jiri Denemark 2020-03-25 14:52:01 +01:00
parent b239a60967
commit 3c650a8f7a

View File

@ -1559,18 +1559,14 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUx86Map, x86MapFree);
static virCPUx86MapPtr
virCPUx86LoadMap(void)
{
virCPUx86MapPtr map;
g_autoptr(virCPUx86Map) map = NULL;
map = g_new0(virCPUx86Map, 1);
if (cpuMapLoad("x86", x86VendorParse, x86FeatureParse, x86ModelParse, map) < 0)
goto error;
return NULL;
return map;
error:
x86MapFree(map);
return NULL;
return g_steal_pointer(&map);
}