[U-Boot] [PATCH 10/14] mkimage: Fix missing free() in fit_extract_data()

Simon Glass sjg at chromium.org
Wed Mar 16 14:45:40 CET 2016


The 'buf' variable is not freed. Fix it.

Reported-by: Coverity (CID: 138492)
Signed-off-by: Simon Glass <sjg at chromium.org>
---

 tools/fit_image.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/fit_image.c b/tools/fit_image.c
index bfb43b2..e628212 100644
--- a/tools/fit_image.c
+++ b/tools/fit_image.c
@@ -452,6 +452,8 @@ static int fit_extract_data(struct image_tool_params *params, const char *fname)
 err_munmap:
 	munmap(fdt, sbuf.st_size);
 err:
+	if (buf)
+		free(buf);
 	close(fd);
 	return ret;
 }
-- 
2.7.0.rc3.207.g0ac5344



More information about the U-Boot mailing list