]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
cpu_x86: Introduce virCPUx86SignaturesFree
authorJiri Denemark <jdenemar@redhat.com>
Thu, 26 Mar 2020 14:23:28 +0000 (15:23 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 8 Apr 2020 15:43:22 +0000 (17:43 +0200)
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>
src/cpu/cpu_x86.c

index b6ba26b0d0e4cf4d2f614a034e424829ee2b2c5d..dd936e28a4aca25562fa3fe08c237e17bf5d2ff5 100644 (file)
@@ -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)