From ab73fe59be690f488466706d89ac6a96dc845e09 Mon Sep 17 00:00:00 2001 From: Wen Congyang Date: Wed, 30 May 2012 17:20:41 +0800 Subject: [PATCH] avoid closing uninitialized fd 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index d96040a819..cadb3db609 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -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;