]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: Fix memory leak for distances in virDomainNumaFree
authorJohn Ferlan <jferlan@redhat.com>
Tue, 21 Nov 2017 23:18:46 +0000 (18:18 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Fri, 1 Dec 2017 11:28:24 +0000 (06:28 -0500)
Commit id '74119a03f' neglected to clean up @distances when
the numa definition is cleaned up.

src/conf/numa_conf.c

index eadf8f2282942b640023312089f40643444652a9..c906a53de07f2223875137c7451723fc13a21634 100644 (file)
@@ -362,6 +362,9 @@ virDomainNumaFree(virDomainNumaPtr numa)
     for (i = 0; i < numa->nmem_nodes; i++) {
         virBitmapFree(numa->mem_nodes[i].cpumask);
         virBitmapFree(numa->mem_nodes[i].nodeset);
+
+        if (numa->mem_nodes[i].ndistances > 0)
+            VIR_FREE(numa->mem_nodes[i].distances);
     }
     VIR_FREE(numa->mem_nodes);