提交 3c650a8f 编写于 作者: J Jiri Denemark

cpu_x86: Use g_auto* in virCPUx86LoadMap

Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 b239a609
......@@ -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 map;
return NULL;
error:
x86MapFree(map);
return NULL;
return g_steal_pointer(&map);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册