]> 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)
committerEric Blake <eblake@redhat.com>
Wed, 30 May 2012 19:55:49 +0000 (13:55 -0600)
If the system does not support bypass cache, we will close fd,
but it is uninitialized.

src/qemu/qemu_driver.c

index 070fbb3f349217d9dd28454d2ea761e31ee56e2f..d3f74d24a4d0b0b1bf0eed2eaf9784fcd8adebf0 100644 (file)
@@ -4010,7 +4010,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;