[BusyBox-cvs] busybox/findutils grep.c,1.75,1.76

Aaron Lehmann aaronl at busybox.net
Thu Nov 28 11:28:00 UTC 2002


Update of /var/cvs/busybox/findutils
In directory winder:/tmp/cvs-serv23182/findutils

Modified Files:
	grep.c 
Log Message:
Change if(x)free(x); to free(x);


Index: grep.c
===================================================================
RCS file: /var/cvs/busybox/findutils/grep.c,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -d -r1.75 -r1.76
--- grep.c	22 Feb 2002 22:08:16 -0000	1.75
+++ grep.c	28 Nov 2002 11:27:25 -0000	1.76
@@ -153,8 +153,7 @@
 			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 @@
 	while (--nregexes >= 0) {
 		regfree(&(regexes[nregexes]));
 	}
-	if (regexes)
-	    free(regexes);
+	free(regexes);
 }
 #endif
 




More information about the busybox-cvs mailing list