From: Peter Tyser Date: Wed, 5 Aug 2009 21:18:44 +0000 (-0500) Subject: hush: Fix bogus free() call X-Git-Tag: v2009.08-rc2~12 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=197324d7d998a791e5137b8176981b4af25220ae;p=u-boot 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 --- diff --git a/common/hush.c b/common/hush.c index 97fd07067e..528dd254a5 100644 --- a/common/hush.c +++ b/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);