tools: imx8image: Fix handle leak
PATCH 1/1 tools: imx8image: Fix handle leak
The handle "fd" was created in imx8image.c:249 by calling the "fopen" function and is lost in imx8image.c:282.
Should close the 'fd' file descriptor before exiting the parse_cfg_file(image_t *param_stack, char *name) function.
--- tools/imx8image.c | 1 + 1 file changed, 1 insertion(+)
tools/imx8image.c +1 -0
@@ -279,6 +279,7 @@ static uint32_t parse_cfg_file(image_t *param_stack, char *name) } } +fclose (fd);return 0 ; }
Signature · 1 line
2.17.1
Quoted 6 lines · Mikhail Ilin
The handle "fd" was created in imx8image.c:249 by calling the "fopen" function and is lost in imx8image.c:282.
Should close the 'fd' file descriptor before exiting theparse_cfg_file(image_t *param_stack, char *name)function.
Quoted 6 lines
Fixes a2b96ece5be1 ("tools: add i.MX8/8X image support")Signed-off-by Mikhail Ilin <[email protected]>--- tools/imx8image.c | 1 + 1 file changed, 1 insertion(+)
PATCH 1/1 tools: imx8image: Fix handle leak
In reply to Mikhail IlinQuoted 7 lines
The handle "fd" was created in imx8image.c:249 by calling the "fopen"
function and is lost in imx8image.c:282.
Should close the 'fd' file descriptor before exiting theparse_cfg_file(image_t *param_stack, char *name)function.Fixes a2b96ece5be1 ("tools: add i.MX8/8X image support")Signed-off-by Mikhail Ilin <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected] =====================================================================