cpu_x86: Use g_auto* in x86EncodePolicy

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 11:30:43 +01:00
parent 9bb9cbf676
commit 5b45d2cf1f

View File

@ -2164,7 +2164,7 @@ x86EncodePolicy(virCPUx86Data *data,
virCPUx86MapPtr map,
virCPUFeaturePolicy policy)
{
virCPUx86ModelPtr model;
g_autoptr(virCPUx86Model) model = NULL;
if (!(model = x86ModelFromCPU(cpu, map, policy)))
return -1;
@ -2172,7 +2172,6 @@ x86EncodePolicy(virCPUx86Data *data,
*data = model->data;
model->data.len = 0;
model->data.items = NULL;
x86ModelFree(model);
return 0;
}