Skip to contentSkip to conversation

tools: imx8mimage: Fix handle leak

PATCH New Mikhail Ilin 2 participants 2 messages Nov 23, 2022 – Jan 31, 2023 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools: imx8mimage: Fix handle leak

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")
---
 tools/imx8mimage.c | 1 +
 1 file changed, 1 insertion(+)
tools/imx8mimage.c +1 -0
index 35d0a92bfd..3ca79d865a 100644
@@ -207,6 +207,7 @@ static uint32_t parse_cfg_file(char *name)
 		}
 	}
 
+	fclose(fd);
 	return 0;
 }
 
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 tools: imx8mimage: Fix handle leak

Quoted 6 lines

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")

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]
=====================================================================