[PATCH] tools: imx8mimage: Fix handle leak

Mikhail Ilin ilin.mikhail.ol at gmail.com
Wed Nov 23 11:48:44 CET 2022


 The handle "fd" was created in imx8mimage.c:178 by calling
 the "fopen" function and is lost in imx8mimage.c:210.
 Should close the 'fd' file descriptor before exiting
 the parse_cfg_file(char *name) function.

Fixes: 6609c2663c9c ("tools: add i.MX8M image support")
Signed-off-by: Mikhail Ilin <ilin.mikhail.ol at gmail.com>
---
 tools/imx8mimage.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/imx8mimage.c b/tools/imx8mimage.c
index 35d0a92bfd..3ca79d865a 100644
--- a/tools/imx8mimage.c
+++ b/tools/imx8mimage.c
@@ -207,6 +207,7 @@ static uint32_t parse_cfg_file(char *name)
 		}
 	}
 
+	fclose(fd);
 	return 0;
 }
 
-- 
2.17.1



More information about the U-Boot mailing list