summaryrefslogtreecommitdiff
path: root/common/hush.c
diff options
context:
space:
mode:
authorPeter Tyser <ptyser@xes-inc.com>2009-08-05 16:18:44 -0500
committerWolfgang Denk <wd@denx.de>2009-08-09 23:02:42 +0200
commit197324d7d998a791e5137b8176981b4af25220ae (patch)
tree603f1268dcdc32df2cbffa6f0b92e6e060763007 /common/hush.c
parentff27650bb255e2275a212357b78c3b77cbf1d2e9 (diff)
downloadu-boot-imx-197324d7d998a791e5137b8176981b4af25220ae.zip
u-boot-imx-197324d7d998a791e5137b8176981b4af25220ae.tar.gz
u-boot-imx-197324d7d998a791e5137b8176981b4af25220ae.tar.bz2
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>
Diffstat (limited to 'common/hush.c')
-rw-r--r--common/hush.c2
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);