a41c76
From 75afc6d9dc443666e1207ef6f1c968abdfec712a Mon Sep 17 00:00:00 2001
a41c76
Message-Id: <75afc6d9dc443666e1207ef6f1c968abdfec712a@dist-git>
a41c76
From: Jiri Denemark <jdenemar@redhat.com>
a41c76
Date: Tue, 26 May 2020 10:59:30 +0200
a41c76
Subject: [PATCH] cpu_x86: Introduce virCPUx86SignaturesFree
a41c76
MIME-Version: 1.0
a41c76
Content-Type: text/plain; charset=UTF-8
a41c76
Content-Transfer-Encoding: 8bit
a41c76
a41c76
The function will be used for freeing virCPUx86Signatures structure
a41c76
introduced later in this series.
a41c76
a41c76
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
a41c76
Reviewed-by: Ján Tomko <jtomko@redhat.com>
a41c76
(cherry picked from commit 372b2cf1ca3f4361546732a3f5f9c0c0be2591e9)
a41c76
a41c76
https://bugzilla.redhat.com/show_bug.cgi?id=1840010
a41c76
a41c76
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
a41c76
Message-Id: <163ef39d14ce5457272e7508172f64d58d22a56b.1590483392.git.jdenemar@redhat.com>
a41c76
Reviewed-by: Ján Tomko <jtomko@redhat.com>
a41c76
---
a41c76
 src/cpu/cpu_x86.c | 11 +++++++++--
a41c76
 1 file changed, 9 insertions(+), 2 deletions(-)
a41c76
a41c76
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
a41c76
index 9248403eff..ed2090b0c6 100644
a41c76
--- a/src/cpu/cpu_x86.c
a41c76
+++ b/src/cpu/cpu_x86.c
a41c76
@@ -1090,6 +1090,13 @@ x86FeatureParse(xmlXPathContextPtr ctxt,
a41c76
 }
a41c76
 
a41c76
 
a41c76
+static void
a41c76
+virCPUx86SignaturesFree(uint32_t *signatures)
a41c76
+{
a41c76
+    g_free(signatures);
a41c76
+}
a41c76
+
a41c76
+
a41c76
 static int
a41c76
 virCPUx86SignaturesCopy(virCPUx86ModelPtr dst,
a41c76
                         virCPUx86ModelPtr src)
a41c76
@@ -1149,7 +1156,7 @@ x86ModelFree(virCPUx86ModelPtr model)
a41c76
         return;
a41c76
 
a41c76
     g_free(model->name);
a41c76
-    g_free(model->signatures);
a41c76
+    virCPUx86SignaturesFree(model->signatures);
a41c76
     virCPUx86DataClear(&model->data);
a41c76
     g_free(model);
a41c76
 }
a41c76
@@ -1414,7 +1421,7 @@ x86ModelParseSignatures(virCPUx86ModelPtr model,
a41c76
         return n;
a41c76
 
a41c76
     /* Remove inherited signatures. */
a41c76
-    VIR_FREE(model->signatures);
a41c76
+    virCPUx86SignaturesFree(model->signatures);
a41c76
 
a41c76
     model->nsignatures = n;
a41c76
     if (VIR_ALLOC_N(model->signatures, n) < 0)
a41c76
-- 
a41c76
2.26.2
a41c76