From: Alistair Francis <[email protected]>
Coverity: CID 1642764
Fixes: f62226f7dc4 ("hw/core/loader: improve error handling in image loading
functions")
Signed-off-by: Alistair Francis <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Vishal Chourasia <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Alistair Francis <[email protected]>
---
hw/core/loader.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/core/loader.c b/hw/core/loader.c
index b7638ccd72..3d2c1ae286 100644
--- a/hw/core/loader.c
+++ b/hw/core/loader.c
@@ -86,6 +86,7 @@ int64_t get_image_size(const char *filename, Error **errp)
if (size < 0) {
error_setg_errno(errp, errno, "lseek failure: %s", filename);
+ close(fd);
return -1;
}
--
2.52.0