]> git.baikalelectronics.ru Git - uboot.git/commitdiff
tools: imx8image: Fix handle leak
authorMikhail Ilin <ilin.mikhail.ol@gmail.com>
Wed, 23 Nov 2022 10:59:49 +0000 (13:59 +0300)
committerStefano Babic <sbabic@denx.de>
Mon, 30 Jan 2023 22:23:01 +0000 (23:23 +0100)
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.

Fixes: e39bfc04356a ("tools: add i.MX8/8X image support")
Signed-off-by: Mikhail Ilin <ilin.mikhail.ol@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
tools/imx8image.c

index 01e14869114f1c008060cb38621622d178fab6a9..395d5c64bdf005afe68bb10ee05d845cd261bcea 100644 (file)
@@ -279,6 +279,7 @@ static uint32_t parse_cfg_file(image_t *param_stack, char *name)
                }
        }
 
+       fclose(fd);
        return 0;
 }