Переглянути джерело

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>
Heinrich Schuchardt 4 роки тому
батько
коміт
f4070e6f6c
1 змінених файлів з 1 додано та 2 видалено
  1. 1 2
      common/cli_hush.c

+ 1 - 2
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] =