From: Jiri Denemark Date: Wed, 25 Mar 2020 10:31:29 +0000 (+0100) Subject: cpu_x86: Use g_auto* in virCPUx86CheckFeature X-Git-Tag: v6.3.0-rc1~188 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b5f1ca58e8f12bc7b768206cb9c7c2ef237e3ff;p=thirdparty%2Flibvirt.git cpu_x86: Use g_auto* in virCPUx86CheckFeature Signed-off-by: Jiri Denemark Reviewed-by: Ján Tomko --- diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index afdde24754..3bb212a909 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -2278,21 +2278,16 @@ static int virCPUx86CheckFeature(const virCPUDef *cpu, const char *name) { - int ret = -1; virCPUx86MapPtr map; - virCPUx86ModelPtr model = NULL; + g_autoptr(virCPUx86Model) model = NULL; if (!(map = virCPUx86GetMap())) return -1; if (!(model = x86ModelFromCPU(cpu, map, -1))) - goto cleanup; - - ret = x86FeatureInData(name, &model->data, map); + return -1; - cleanup: - x86ModelFree(model); - return ret; + return x86FeatureInData(name, &model->data, map); }