summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko2007-04-10 21:41:16 +0000
committerDenis Vlasenko2007-04-10 21:41:16 +0000
commit89054964443b5cb14cba673b86306f534810404a (patch)
tree8fabd70981b721e4ee806b211d2b1cc7f8643526
parentc6758a07c68033627a692cda27aebc8f6a662e7f (diff)
downloadbusybox-89054964443b5cb14cba673b86306f534810404a.zip
busybox-89054964443b5cb14cba673b86306f534810404a.tar.gz
xargs: fix my brain fart (resulted in memory leak)
-rw-r--r--findutils/xargs.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/findutils/xargs.c b/findutils/xargs.c
index 2b3a508..695091a 100644
--- a/findutils/xargs.c
+++ b/findutils/xargs.c
@@ -113,10 +113,10 @@ static xlist_t *process_stdin(xlist_t *list_arg,
xlist_t *cur;
xlist_t *prev;
- cur = list_arg;
+ prev = cur = list_arg;
while (1) {
- prev = cur;
if (!cur) break;
+ prev = cur;
line_l += cur->length;
cur = cur->link;
}
@@ -142,7 +142,6 @@ static xlist_t *process_stdin(xlist_t *list_arg,
goto set;
}
} else { /* if(state == NORM) */
-
if (ISSPACE(c)) {
if (s) {
unexpected_eof:
@@ -214,10 +213,10 @@ static xlist_t *process_stdin(xlist_t *list_arg,
xlist_t *cur;
xlist_t *prev;
- cur = list_arg;
+ prev = cur = list_arg;
while (1) {
- prev = cur;
if (!cur) break;
+ prev = cur;
line_l += cur->length;
cur = cur->link;
}
@@ -304,10 +303,10 @@ static xlist_t *process0_stdin(xlist_t *list_arg,
xlist_t *cur;
xlist_t *prev;
- cur = list_arg;
+ prev = cur = list_arg;
while (1) {
- prev = cur;
if (!cur) break;
+ prev = cur;
line_l += cur->length;
cur = cur->link;
}