libvirt/SOURCES/libvirt-cpu_x86-Introduce-virCPUx86SignaturesFree.patch
2021-09-10 11:58:15 +00:00

65 lines
1.9 KiB
Diff

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