]> git.sur5r.net Git - u-boot/commitdiff
hush: Fix bogus free() call
authorPeter Tyser <ptyser@xes-inc.com>
Wed, 5 Aug 2009 21:18:44 +0000 (16:18 -0500)
committerWolfgang Denk <wd@denx.de>
Sun, 9 Aug 2009 21:02:42 +0000 (23:02 +0200)
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>
common/hush.c

index 97fd07067ea7bf770e33faacfc18d5afe2fea514..528dd254a5064cf6c45c00f9b8689858222de306 100644 (file)
@@ -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);