]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
avoid closing uninitialized fd
authorWen Congyang <wency@cn.fujitsu.com>
Wed, 30 May 2012 09:20:41 +0000 (17:20 +0800)
committerCole Robinson <crobinso@redhat.com>
Fri, 15 Jun 2012 14:58:24 +0000 (10:58 -0400)
If the system does not support bypass cache, we will close fd,
but it is uninitialized.
(cherry picked from commit 0a045f01cfa48fabd41c801e3f44034a4e6da485)

src/qemu/qemu_driver.c

index 359e0c46f47a5a7be3e0404da2edb14924f43c52..2733b0f2014fd1f532ff7813a2185f2224131991 100644 (file)
@@ -3867,7 +3867,7 @@ qemuDomainSaveImageOpen(struct qemud_driver *driver,
                         const char *xmlin, int state, bool edit,
                         bool unlink_corrupt)
 {
-    int fd;
+    int fd = -1;
     struct qemud_save_header header;
     char *xml = NULL;
     virDomainDefPtr def = NULL;