From b91ae8a08c0906011e9ff2ed4f8c8fce908603b5 Mon Sep 17 00:00:00 2001 Message-Id: From: Jiri Denemark Date: Tue, 26 May 2020 10:59:16 +0200 Subject: [PATCH] cpu_x86: Use g_auto* in x86EncodePolicy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jiri Denemark Reviewed-by: Ján Tomko (cherry picked from commit 5b45d2cf1ff0d2d972f103a678c01bc0eb7c1e18) https://bugzilla.redhat.com/show_bug.cgi?id=1840010 Signed-off-by: Jiri Denemark Message-Id: Reviewed-by: Ján Tomko --- src/cpu/cpu_x86.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index dba4165527..fd410aeafb 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -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; } -- 2.26.2