render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
c1c534
From 8e0151c7b6ce80dc8145511848155e6170ce2bf6 Mon Sep 17 00:00:00 2001
c1c534
Message-Id: <8e0151c7b6ce80dc8145511848155e6170ce2bf6@dist-git>
c1c534
From: John Ferlan <jferlan@redhat.com>
c1c534
Date: Mon, 4 Dec 2017 13:38:53 +0100
c1c534
Subject: [PATCH] conf: Fix memory leak for distances in virDomainNumaFree
c1c534
c1c534
https://bugzilla.redhat.com/show_bug.cgi?id=1454889
c1c534
c1c534
Commit id '74119a03f' neglected to clean up @distances when
c1c534
the numa definition is cleaned up.
c1c534
c1c534
(cherry picked from commit 9f0ccc717ba9026c30ce38951a354dd66fa12e3b)
c1c534
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
c1c534
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c1c534
---
c1c534
 src/conf/numa_conf.c | 3 +++
c1c534
 1 file changed, 3 insertions(+)
c1c534
c1c534
diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c
c1c534
index 8fc3b0a196..466b64d5fa 100644
c1c534
--- a/src/conf/numa_conf.c
c1c534
+++ b/src/conf/numa_conf.c
c1c534
@@ -362,6 +362,9 @@ virDomainNumaFree(virDomainNumaPtr numa)
c1c534
     for (i = 0; i < numa->nmem_nodes; i++) {
c1c534
         virBitmapFree(numa->mem_nodes[i].cpumask);
c1c534
         virBitmapFree(numa->mem_nodes[i].nodeset);
c1c534
+
c1c534
+        if (numa->mem_nodes[i].ndistances > 0)
c1c534
+            VIR_FREE(numa->mem_nodes[i].distances);
c1c534
     }
c1c534
     VIR_FREE(numa->mem_nodes);
c1c534
 
c1c534
-- 
c1c534
2.15.1
c1c534