summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2020-04-28 21:56:10 +0200
committerTom Rini <trini@konsulko.com>2020-05-01 11:34:01 -0400
commitf4070e6f6c680034d67f13b878f0da55b3b51f92 (patch)
tree636a91e95b018a0d89436db9f53d8e84068a6115 /common
parent4fb0f55fd294aca02407ef1def74a22612fa041b (diff)
hush: avoid NULL check before free()
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>
Diffstat (limited to 'common')
-rw-r--r--common/cli_hush.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/common/cli_hush.c b/common/cli_hush.c
index cf1e273485..a62af07cc5 100644
--- 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] =