]> 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>
Thu, 14 Jun 2012 22:23:21 +0000 (18:23 -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 d96040a8190f0d638c96a4ad6a0c19d544437f67..cadb3db6095b239b9a5b35594da219e84f31bf10 100644 (file)
@@ -3989,7 +3989,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;