[PATCH] tools: imx8image: Fix potential memory leak

Maks Mishin maks.mishinfz at gmail.com
Sun Feb 2 18:05:17 CET 2025


Dynamic memory, referenced by 'line', is allocated at imx8image.c:270
by calling function 'getline' and lost at imx8image.c:294.

Signed-off-by: Maks Mishin <maks.mishinFZ at gmail.com>
---
 tools/imx8image.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/imx8image.c b/tools/imx8image.c
index 15510d3e71..0135b19095 100644
--- a/tools/imx8image.c
+++ b/tools/imx8image.c
@@ -290,6 +290,7 @@ static uint32_t parse_cfg_file(image_t *param_stack, char *name)
 		}
 	}
 
+	free(line);
 	fclose(fd);
 	return 0;
 }
-- 
2.34.1



More information about the U-Boot mailing list