summaryrefslogtreecommitdiff
path: root/findutils
diff options
context:
space:
mode:
Diffstat (limited to 'findutils')
-rw-r--r--findutils/grep.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/findutils/grep.c b/findutils/grep.c
index 6fe1833..cc2b697 100644
--- a/findutils/grep.c
+++ b/findutils/grep.c
@@ -153,8 +153,7 @@ static void grep_file(FILE *file)
else { /* no match */
/* Add the line to the circular 'before' buffer */
if(lines_before) {
- if(before_buf[curpos])
- free(before_buf[curpos]);
+ free(before_buf[curpos]);
before_buf[curpos] = xstrdup(line);
curpos = (curpos + 1) % lines_before;
}
@@ -225,8 +224,7 @@ static void destroy_regexes(void)
while (--nregexes >= 0) {
regfree(&(regexes[nregexes]));
}
- if (regexes)
- free(regexes);
+ free(regexes);
}
#endif