aboutsummaryrefslogtreecommitdiff
path: root/findutils/grep.c
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-11-19 10:59:37 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-11-19 10:59:37 +0000
commit2a1e33eeca420fb0dbce842531dd9bdb165318f2 (patch)
tree063ad29419100609460d5741748686368382129f /findutils/grep.c
parent44760fe6bbe3559fcde1e1dfc1d8b377db819239 (diff)
downloadbusybox-w32-2a1e33eeca420fb0dbce842531dd9bdb165318f2.tar.gz
busybox-w32-2a1e33eeca420fb0dbce842531dd9bdb165318f2.tar.bz2
busybox-w32-2a1e33eeca420fb0dbce842531dd9bdb165318f2.zip
More scrubbing
git-svn-id: svn://busybox.net/trunk/busybox@3713 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'findutils/grep.c')
-rw-r--r--findutils/grep.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/findutils/grep.c b/findutils/grep.c
index b98b724ac..7c1e0f60d 100644
--- a/findutils/grep.c
+++ b/findutils/grep.c
@@ -223,9 +223,10 @@ static void destroy_regexes()
223 223
224 /* destroy all the elments in the array */ 224 /* destroy all the elments in the array */
225 while (--nregexes >= 0) { 225 while (--nregexes >= 0) {
226 regfree(&regexes[nregexes]); 226 regfree(regexes[nregexes]);
227 } 227 }
228 free(regexes); 228 if (regexes)
229 free(regexes);
229} 230}
230#endif 231#endif
231 232
@@ -239,8 +240,7 @@ extern int grep_main(int argc, char **argv)
239 240
240#ifdef CONFIG_FEATURE_CLEAN_UP 241#ifdef CONFIG_FEATURE_CLEAN_UP
241 /* destroy command strings on exit */ 242 /* destroy command strings on exit */
242 if (atexit(destroy_regexes) == -1) 243 atexit(destroy_regexes);
243 perror_msg_and_die("atexit");
244#endif 244#endif
245 245
246#ifdef CONFIG_FEATURE_GREP_EGREP_ALIAS 246#ifdef CONFIG_FEATURE_GREP_EGREP_ALIAS