瀏覽代碼

hush: Fix bogus free() call

An off-by-one error in hush.c resulted in an unintentional free() call
every time a command was executed

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
Peter Tyser 15 年之前
父節點
當前提交
197324d7d9
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      common/hush.c

+ 1 - 1
common/hush.c

@@ -2002,7 +2002,7 @@ static int free_pipe(struct pipe *pi, int indent)
 #ifndef __U_BOOT__
 			globfree(&child->glob_result);
 #else
-			for (a = child->argc;a >= 0;a--) {
+			for (a = 0; a < child->argc; a++) {
 				free(child->argv[a]);
 			}
 					free(child->argv);