cpu_x86: Use g_auto* in virCPUx86CheckFeature

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:31:29 +01:00
parent e6e54fcebe
commit 3b5f1ca58e

View File

@ -2278,21 +2278,16 @@ static int
virCPUx86CheckFeature(const virCPUDef *cpu, virCPUx86CheckFeature(const virCPUDef *cpu,
const char *name) const char *name)
{ {
int ret = -1;
virCPUx86MapPtr map; virCPUx86MapPtr map;
virCPUx86ModelPtr model = NULL; g_autoptr(virCPUx86Model) model = NULL;
if (!(map = virCPUx86GetMap())) if (!(map = virCPUx86GetMap()))
return -1; return -1;
if (!(model = x86ModelFromCPU(cpu, map, -1))) if (!(model = x86ModelFromCPU(cpu, map, -1)))
goto cleanup; return -1;
ret = x86FeatureInData(name, &model->data, map); return x86FeatureInData(name, &model->data, map);
cleanup:
x86ModelFree(model);
return ret;
} }