projects
/
platform
/
kernel
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3fc85a7
)
mkimage: fit: Free buf directly in fit_extract_data()
author
Bin Meng
<bin.meng@windriver.com>
Sat, 18 Apr 2020 08:59:11 +0000
(
01:59
-0700)
committer
Tom Rini
<trini@konsulko.com>
Fri, 24 Apr 2020 14:51:56 +0000
(10:51 -0400)
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
patch
|
blob
|
history
diff --git
a/tools/fit_image.c
b/tools/fit_image.c
index c37cae3b260c6b36738164a5c43a27e6cb604e10..4aeabbcfe97b64f6dd728e1c74f8c904df13bc64 100644
(file)
--- a/
tools/fit_image.c
+++ b/
tools/fit_image.c
@@
-534,8
+534,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;
}