Blame SOURCES/libvirt-virDomainDefParseXML-set-the-argument-of-virBitmapFree-to-NULL-after-calling-virBitmapFree.patch

43fe83
From 405530fa1be17ff5b8dcff6785b67c63eebf49f7 Mon Sep 17 00:00:00 2001
43fe83
Message-Id: <405530fa1be17ff5b8dcff6785b67c63eebf49f7.1379193141.git.jdenemar@redhat.com>
43fe83
From: "Liuji (Jeremy)" <jeremy.liu@huawei.com>
43fe83
Date: Wed, 11 Sep 2013 09:58:51 +0200
43fe83
Subject: [PATCH] virDomainDefParseXML: set the argument of virBitmapFree to
43fe83
 NULL after calling virBitmapFree
43fe83
43fe83
https://bugzilla.redhat.com/show_bug.cgi?id=1006722
43fe83
43fe83
After freeing the bitmap pointer, it must set the pointer to NULL.
43fe83
This will avoid any other use of the freed memory of the bitmap pointer.
43fe83
43fe83
https://bugzilla.redhat.com/show_bug.cgi?id=1006710
43fe83
43fe83
Signed-off-by: Liuji (Jeremy) <jeremy.liu@huawei.com>
43fe83
(cherry picked from commit ef5d51d491356f1f4287aa3a8b908b183b6dd9aa)
43fe83
---
43fe83
 src/conf/domain_conf.c | 4 +++-
43fe83
 1 file changed, 3 insertions(+), 1 deletion(-)
43fe83
43fe83
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
43fe83
index d6b4ea7..566940c 100644
43fe83
--- a/src/conf/domain_conf.c
43fe83
+++ b/src/conf/domain_conf.c
43fe83
@@ -11251,8 +11251,10 @@ virDomainDefParseXML(xmlDocPtr xml,
43fe83
                     }
43fe83
 
43fe83
                     /* Ignore 'nodeset' if 'placement' is 'auto' finally */
43fe83
-                    if (placement_mode == VIR_NUMA_TUNE_MEM_PLACEMENT_MODE_AUTO)
43fe83
+                    if (placement_mode == VIR_NUMA_TUNE_MEM_PLACEMENT_MODE_AUTO) {
43fe83
                         virBitmapFree(def->numatune.memory.nodemask);
43fe83
+                        def->numatune.memory.nodemask = NULL;
43fe83
+                    }
43fe83
 
43fe83
                     /* Copy 'placement' of <numatune> to <vcpu> if its 'placement'
43fe83
                      * is not specified and 'placement' of <numatune> is specified.
43fe83
-- 
43fe83
1.8.3.2
43fe83