提交 a32a3e93 编写于 作者: J Jiri Denemark

cpu_x86: Use g_auto* in virCPUx86CopyMigratable

Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 ff6897c8
......@@ -3109,7 +3109,7 @@ x86FeatureFilterMigratable(const char *name,
static virCPUDefPtr
virCPUx86CopyMigratable(virCPUDefPtr cpu)
{
virCPUDefPtr copy;
g_autoptr(virCPUDef) copy = NULL;
virCPUx86MapPtr map;
if (!(map = virCPUx86GetMap()))
......@@ -3120,13 +3120,9 @@ virCPUx86CopyMigratable(virCPUDefPtr cpu)
if (virCPUDefCopyModelFilter(copy, cpu, false,
x86FeatureFilterMigratable, map) < 0)
goto error;
return copy;
return NULL;
error:
virCPUDefFree(copy);
return NULL;
return g_steal_pointer(&copy);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册