render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
a41c76
From b91ae8a08c0906011e9ff2ed4f8c8fce908603b5 Mon Sep 17 00:00:00 2001
a41c76
Message-Id: <b91ae8a08c0906011e9ff2ed4f8c8fce908603b5@dist-git>
a41c76
From: Jiri Denemark <jdenemar@redhat.com>
a41c76
Date: Tue, 26 May 2020 10:59:16 +0200
a41c76
Subject: [PATCH] cpu_x86: Use g_auto* in x86EncodePolicy
a41c76
MIME-Version: 1.0
a41c76
Content-Type: text/plain; charset=UTF-8
a41c76
Content-Transfer-Encoding: 8bit
a41c76
a41c76
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
a41c76
Reviewed-by: Ján Tomko <jtomko@redhat.com>
a41c76
(cherry picked from commit 5b45d2cf1ff0d2d972f103a678c01bc0eb7c1e18)
a41c76
a41c76
https://bugzilla.redhat.com/show_bug.cgi?id=1840010
a41c76
a41c76
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
a41c76
Message-Id: <cf057cf29d8f8f2369eab3afb5202a6466c0dc2e.1590483392.git.jdenemar@redhat.com>
a41c76
Reviewed-by: Ján Tomko <jtomko@redhat.com>
a41c76
---
a41c76
 src/cpu/cpu_x86.c | 3 +--
a41c76
 1 file changed, 1 insertion(+), 2 deletions(-)
a41c76
a41c76
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
a41c76
index dba4165527..fd410aeafb 100644
a41c76
--- a/src/cpu/cpu_x86.c
a41c76
+++ b/src/cpu/cpu_x86.c
a41c76
@@ -2164,7 +2164,7 @@ x86EncodePolicy(virCPUx86Data *data,
a41c76
                 virCPUx86MapPtr map,
a41c76
                 virCPUFeaturePolicy policy)
a41c76
 {
a41c76
-    virCPUx86ModelPtr model;
a41c76
+    g_autoptr(virCPUx86Model) model = NULL;
a41c76
 
a41c76
     if (!(model = x86ModelFromCPU(cpu, map, policy)))
a41c76
         return -1;
a41c76
@@ -2172,7 +2172,6 @@ x86EncodePolicy(virCPUx86Data *data,
a41c76
     *data = model->data;
a41c76
     model->data.len = 0;
a41c76
     model->data.items = NULL;
a41c76
-    x86ModelFree(model);
a41c76
 
a41c76
     return 0;
a41c76
 }
a41c76
-- 
a41c76
2.26.2
a41c76