
18 Apr
2020
18 Apr
'20
10:59 a.m.
From: Bin Meng bin.meng@windriver.com
If given ptr to free() is NULL, no operation is performed. Hence we can just free buf directly in fit_extract_data().
Signed-off-by: Bin Meng bin.meng@windriver.com ---
tools/fit_image.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tools/fit_image.c b/tools/fit_image.c index 05c1f00..965061d 100644 --- a/tools/fit_image.c +++ b/tools/fit_image.c @@ -527,8 +527,7 @@ 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); + free(buf); close(fd); return ret; }
--
2.7.4