]> git.baikalelectronics.ru Git - uboot.git/commitdiff
tools: imx8mimage: Fix handle leak
authorMikhail Ilin <ilin.mikhail.ol@gmail.com>
Wed, 23 Nov 2022 10:48:44 +0000 (13:48 +0300)
committerStefano Babic <sbabic@denx.de>
Mon, 30 Jan 2023 22:23:01 +0000 (23:23 +0100)
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: e1a587f058cc ("tools: add i.MX8M image support")
Signed-off-by: Mikhail Ilin <ilin.mikhail.ol@gmail.com>
tools/imx8mimage.c

index 35d0a92bfdf028f96047e320349f0bc20cf38802..3ca79d865aa1a179b4dfc776062ef7f82eefe1c0 100644 (file)
@@ -207,6 +207,7 @@ static uint32_t parse_cfg_file(char *name)
                }
        }
 
+       fclose(fd);
        return 0;
 }