Skip to contentSkip to conversation

hush: Fix bogus free() call

PATCH New Peter Tyser 2 participants 2 messages Aug 5, 2009 – Aug 9, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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

---
 common/hush.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
common/hush.c +1 -1
index 97fd070..528dd25 100644
@@ -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);
Signature · 1 line
1.6.2.1
#1 lore raw

PATCH 1/1 hush: Fix bogus free() call

Dear Peter Tyser,

Quoted 7 lines · In message <[email protected]> you wrote:

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

---
 common/hush.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Nothing ever becomes real until it is experienced.       - John Keats