render / rpms / libvirt

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