From: Peter Tyser Date: Wed, 5 Aug 2009 16:18:44 -0500 Subject: [U-Boot] [PATCH] hush: Fix bogus free() call Message-ID: <1249507124-22350-1-git-send-email-ptyser@xes-inc.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- common/hush.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/common/hush.c b/common/hush.c index 97fd070..528dd25 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); -- 1.6.2.1