[libvirt] [PATCH] snapshot: fix double free issue for qemuImgBinary value in qemu_driver

Guannan Ren gren at redhat.com
Sat Sep 10 15:05:59 UTC 2011


    *src/qemu/qemu_driver.c: in qemuDomainSnapshotForEachQcow()
     it will free up the memory of qemu_driver->qemuImgBinary in the
     cleanup tag which leads to the garbage value of qemuImgBinary and
     libvirtd crash when running "virsh snapshot-create" command next time.
---
 src/qemu/qemu_driver.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index b94d1c4..bbe113f 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1735,7 +1735,7 @@ qemuDomainSnapshotForEachQcow2(struct qemud_driver *driver,
     ret = skipped ? 1 : 0;
 
 cleanup:
-    VIR_FREE(qemuimgarg[0]);
+    qemuimgarg[0] = NULL;
     return ret;
 }
 
-- 
1.7.1




More information about the libvir-list mailing list