diff options
author | Aaron Lehmann <aaronl@vitelius.com> | 2002-11-28 11:27:31 +0000 |
---|---|---|
committer | Aaron Lehmann <aaronl@vitelius.com> | 2002-11-28 11:27:31 +0000 |
commit | a170e1c858d35c474ceb9fecb41b37d681424094 (patch) | |
tree | cda2b13f10ca1ab0a3559d4b6ff663ed20d7106c /findutils | |
parent | 1652855fbc830f41c7ee56ece1a30b328c4fb395 (diff) | |
download | busybox-w32-a170e1c858d35c474ceb9fecb41b37d681424094.tar.gz busybox-w32-a170e1c858d35c474ceb9fecb41b37d681424094.tar.bz2 busybox-w32-a170e1c858d35c474ceb9fecb41b37d681424094.zip |
Change if(x)free(x); to free(x);
Diffstat (limited to 'findutils')
-rw-r--r-- | findutils/grep.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/findutils/grep.c b/findutils/grep.c index 6fe183325..cc2b697e8 100644 --- a/findutils/grep.c +++ b/findutils/grep.c | |||
@@ -153,8 +153,7 @@ static void grep_file(FILE *file) | |||
153 | else { /* no match */ | 153 | else { /* no match */ |
154 | /* Add the line to the circular 'before' buffer */ | 154 | /* Add the line to the circular 'before' buffer */ |
155 | if(lines_before) { | 155 | if(lines_before) { |
156 | if(before_buf[curpos]) | 156 | free(before_buf[curpos]); |
157 | free(before_buf[curpos]); | ||
158 | before_buf[curpos] = xstrdup(line); | 157 | before_buf[curpos] = xstrdup(line); |
159 | curpos = (curpos + 1) % lines_before; | 158 | curpos = (curpos + 1) % lines_before; |
160 | } | 159 | } |
@@ -225,8 +224,7 @@ static void destroy_regexes(void) | |||
225 | while (--nregexes >= 0) { | 224 | while (--nregexes >= 0) { |
226 | regfree(&(regexes[nregexes])); | 225 | regfree(&(regexes[nregexes])); |
227 | } | 226 | } |
228 | if (regexes) | 227 | free(regexes); |
229 | free(regexes); | ||
230 | } | 228 | } |
231 | #endif | 229 | #endif |
232 | 230 | ||