diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-04-10 21:41:16 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-04-10 21:41:16 +0000 |
commit | 89054964443b5cb14cba673b86306f534810404a (patch) | |
tree | 8fabd70981b721e4ee806b211d2b1cc7f8643526 | |
parent | c6758a07c68033627a692cda27aebc8f6a662e7f (diff) | |
download | busybox-w32-89054964443b5cb14cba673b86306f534810404a.tar.gz busybox-w32-89054964443b5cb14cba673b86306f534810404a.tar.bz2 busybox-w32-89054964443b5cb14cba673b86306f534810404a.zip |
xargs: fix my brain fart (resulted in memory leak)
-rw-r--r-- | findutils/xargs.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/findutils/xargs.c b/findutils/xargs.c index 2b3a5081c..695091a04 100644 --- a/findutils/xargs.c +++ b/findutils/xargs.c | |||
@@ -113,10 +113,10 @@ static xlist_t *process_stdin(xlist_t *list_arg, | |||
113 | xlist_t *cur; | 113 | xlist_t *cur; |
114 | xlist_t *prev; | 114 | xlist_t *prev; |
115 | 115 | ||
116 | cur = list_arg; | 116 | prev = cur = list_arg; |
117 | while (1) { | 117 | while (1) { |
118 | prev = cur; | ||
119 | if (!cur) break; | 118 | if (!cur) break; |
119 | prev = cur; | ||
120 | line_l += cur->length; | 120 | line_l += cur->length; |
121 | cur = cur->link; | 121 | cur = cur->link; |
122 | } | 122 | } |
@@ -142,7 +142,6 @@ static xlist_t *process_stdin(xlist_t *list_arg, | |||
142 | goto set; | 142 | goto set; |
143 | } | 143 | } |
144 | } else { /* if(state == NORM) */ | 144 | } else { /* if(state == NORM) */ |
145 | |||
146 | if (ISSPACE(c)) { | 145 | if (ISSPACE(c)) { |
147 | if (s) { | 146 | if (s) { |
148 | unexpected_eof: | 147 | unexpected_eof: |
@@ -214,10 +213,10 @@ static xlist_t *process_stdin(xlist_t *list_arg, | |||
214 | xlist_t *cur; | 213 | xlist_t *cur; |
215 | xlist_t *prev; | 214 | xlist_t *prev; |
216 | 215 | ||
217 | cur = list_arg; | 216 | prev = cur = list_arg; |
218 | while (1) { | 217 | while (1) { |
219 | prev = cur; | ||
220 | if (!cur) break; | 218 | if (!cur) break; |
219 | prev = cur; | ||
221 | line_l += cur->length; | 220 | line_l += cur->length; |
222 | cur = cur->link; | 221 | cur = cur->link; |
223 | } | 222 | } |
@@ -304,10 +303,10 @@ static xlist_t *process0_stdin(xlist_t *list_arg, | |||
304 | xlist_t *cur; | 303 | xlist_t *cur; |
305 | xlist_t *prev; | 304 | xlist_t *prev; |
306 | 305 | ||
307 | cur = list_arg; | 306 | prev = cur = list_arg; |
308 | while (1) { | 307 | while (1) { |
309 | prev = cur; | ||
310 | if (!cur) break; | 308 | if (!cur) break; |
309 | prev = cur; | ||
311 | line_l += cur->length; | 310 | line_l += cur->length; |
312 | cur = cur->link; | 311 | cur = cur->link; |
313 | } | 312 | } |