projects
/
oweals
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4fb0f55
)
hush: avoid NULL check before free()
author
Heinrich Schuchardt
<xypron.glpk@gmx.de>
Tue, 28 Apr 2020 19:56:10 +0000
(21:56 +0200)
committer
Tom Rini
<trini@konsulko.com>
Fri, 1 May 2020 15:34:01 +0000
(11:34 -0400)
free() checks if its argument is NULL. Don't duplicate this in the calling
code.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
common/cli_hush.c
patch
|
blob
|
history
diff --git
a/common/cli_hush.c
b/common/cli_hush.c
index cf1e273485c7e98c82cc897030439faf3a2e917e..a62af07cc5469c080bac40b9d711373a9d4b35a6 100644
(file)
--- a/
common/cli_hush.c
+++ b/
common/cli_hush.c
@@
-1849,8
+1849,7
@@
static int run_list_real(struct pipe *pi)
continue;
} else {
/* insert new value from list for variable */
- if (pi->progs->argv[0])
- free(pi->progs->argv[0]);
+ free(pi->progs->argv[0]);
pi->progs->argv[0] = *list++;
#ifndef __U_BOOT__
pi->progs->glob_result.gl_pathv[0] =