Change if(x)free(x); to free(x);

This commit is contained in:
Aaron Lehmann
2002-11-28 11:27:31 +00:00
parent 1652855fbc
commit a170e1c858
16 changed files with 47 additions and 95 deletions

View File

@ -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