
28 Apr
2020
28 Apr
'20
9:56 p.m.
free() checks if its argument is NULL. Don't duplicate this in the calling code.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de --- common/cli_hush.c | 3 +-- 1 file changed, 1 insertion(+), 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] = -- 2.26.2