]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: Fix memory leak in virCPUDefParseXML
authorJohn Ferlan <jferlan@redhat.com>
Tue, 16 Jun 2020 12:07:09 +0000 (08:07 -0400)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 16 Jun 2020 13:01:06 +0000 (15:01 +0200)
Since a08669c31, @tsc is not automatically free'd by any g_auto* method.

Found by Coverity.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/conf/cpu_conf.c

index b40737e407563f0968e69ce1839bb75bc642a38c..e1b0a5653f52df1c09ffe170ccc063a2e5dbab36 100644 (file)
@@ -335,7 +335,7 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt,
     g_autofree char *vendor_id = NULL;
     g_autofree char *tscScaling = NULL;
     g_autofree char *migratable = NULL;
-    virHostCPUTscInfoPtr tsc = NULL;
+    g_autofree virHostCPUTscInfoPtr tsc = NULL;
 
     *cpu = NULL;