[PATCH] qemu: fix a crash when save file can't be opened

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In qemuDomainSaveMemory, wrapperFd might be NULL and should be checked before
calling virFileWrapperFdCatchError. Same in doCoreDump.

Bug: https://bugzilla.redhat.com/show_bug.cgi?id=880919
---
 src/qemu/qemu_driver.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index c526f5f..7892293 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -2906,7 +2906,8 @@ qemuDomainSaveMemory(struct qemud_driver *driver,
 
 cleanup:
     VIR_FORCE_CLOSE(fd);
-    virFileWrapperFdCatchError(wrapperFd);
+    if (wrapperFd)
+        virFileWrapperFdCatchError(wrapperFd);
     virFileWrapperFdFree(wrapperFd);
     VIR_FREE(xml);
 
@@ -3362,7 +3363,8 @@ doCoreDump(struct qemud_driver *driver,
 cleanup:
     VIR_FORCE_CLOSE(fd);
     if (ret != 0) {
-        virFileWrapperFdCatchError(wrapperFd);
+        if (wrapperFd)
+            virFileWrapperFdCatchError(wrapperFd);
         unlink(path);
     }
     virFileWrapperFdFree(wrapperFd);
-- 
1.7.8.6

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]