Message ID | 1587200351-12590-3-git-send-email-bmeng.cn@gmail.com |
---|---|
State | New |
Headers | show |
Series | [1/3] tools: Remove the out-of-date MinGW support codes | expand |
On Sat, Apr 18, 2020 at 01:59:11AM -0700, Bin Meng wrote: > From: Bin Meng <bin.meng at 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 at windriver.com> Applied to u-boot/master, thanks!
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; }