diff options
| author | Heinrich Schuchardt <[email protected]> | 2020-04-28 21:56:10 +0200 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2020-05-01 11:34:01 -0400 |
| commit | f4070e6f6c680034d67f13b878f0da55b3b51f92 (patch) | |
| tree | 636a91e95b018a0d89436db9f53d8e84068a6115 | |
| parent | 4fb0f55fd294aca02407ef1def74a22612fa041b (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 <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
| -rw-r--r-- | common/cli_hush.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/common/cli_hush.c b/common/cli_hush.c index cf1e273485c..a62af07cc54 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] = |
