From 0a045f01cfa48fabd41c801e3f44034a4e6da485 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. --- 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 070fbb3f34..d3f74d24a4 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -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; -- GitLab