aboutsummaryrefslogtreecommitdiff
path: root/findutils
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-11-19 10:59:37 +0000
committerEric Andersen <andersen@codepoet.org>2001-11-19 10:59:37 +0000
commit55805bcba49abf296435be5282eca69c6bd4bb72 (patch)
tree063ad29419100609460d5741748686368382129f /findutils
parentd81891a2e6d52a35b3b633f95716d7a3a88f60c9 (diff)
downloadbusybox-55805bcba49abf296435be5282eca69c6bd4bb72.tar.gz
More scrubbing
Diffstat (limited to 'findutils')
-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()
/* destroy all the elments in the array */
while (--nregexes >= 0) {
- regfree(&regexes[nregexes]);
+ regfree(regexes[nregexes]);
}
- free(regexes);
+ if (regexes)
+ free(regexes);
}
#endif
@@ -239,8 +240,7 @@ extern int grep_main(int argc, char **argv)
#ifdef CONFIG_FEATURE_CLEAN_UP
/* destroy command strings on exit */
- if (atexit(destroy_regexes) == -1)
- perror_msg_and_die("atexit");
+ atexit(destroy_regexes);
#endif
#ifdef CONFIG_FEATURE_GREP_EGREP_ALIAS