]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virDomainDefParseXML: set the argument of virBitmapFree to NULL after calling virBitm...
authorLiuji (Jeremy) <jeremy.liu@huawei.com>
Wed, 11 Sep 2013 02:13:32 +0000 (22:13 -0400)
committerJán Tomko <jtomko@redhat.com>
Mon, 16 Sep 2013 06:57:04 +0000 (08:57 +0200)
After freeing the bitmap pointer, it must set the pointer to NULL.
This will avoid any other use of the freed memory of the bitmap pointer.

https://bugzilla.redhat.com/show_bug.cgi?id=1006710

Signed-off-by: Liuji (Jeremy) <jeremy.liu@huawei.com>
(cherry picked from commit ef5d51d491356f1f4287aa3a8b908b183b6dd9aa)

Conflicts:
src/conf/domain_conf.c

src/conf/domain_conf.c

index 515eda8c657468a9d4d046e0aba5db996782d217..866401375f6ccd3ca04d70b5805f55aaf572b04c 100644 (file)
@@ -8880,8 +8880,10 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
                     }
 
                     /* Ignore 'nodeset' if 'placement' is 'auto' finally */
-                    if (placement_mode == VIR_DOMAIN_NUMATUNE_MEM_PLACEMENT_MODE_AUTO)
+                    if (placement_mode == VIR_DOMAIN_NUMATUNE_MEM_PLACEMENT_MODE_AUTO) {
                         virBitmapFree(def->numatune.memory.nodemask);
+                        def->numatune.memory.nodemask = NULL;
+                    }
 
                     /* Copy 'placement' of <numatune> to <vcpu> if its 'placement'
                      * is not specified and 'placement' of <numatune> is specified.