svn commit: trunk/busybox/libbb

vda at busybox.net vda at busybox.net
Fri Sep 28 22:13:57 UTC 2007


Author: vda
Date: 2007-09-28 15:13:55 -0700 (Fri, 28 Sep 2007)
New Revision: 20104

Log:
more "if (p) free(p)" fixes; fix a typo in comment



Modified:
   trunk/busybox/libbb/getopt32.c
   trunk/busybox/libbb/procps.c


Changeset:
Modified: trunk/busybox/libbb/getopt32.c
===================================================================
--- trunk/busybox/libbb/getopt32.c	2007-09-28 22:07:23 UTC (rev 20103)
+++ trunk/busybox/libbb/getopt32.c	2007-09-28 22:13:55 UTC (rev 20104)
@@ -30,7 +30,7 @@
 
         "r" will add 1    (bit 0)
         "n" will add 2    (bit 1)
-        "u  will add 4    (bit 2)
+        "u" will add 4    (bit 2)
         "g" will add 8    (bit 3)
 
         and so on.  You can also look at the return value as a bit

Modified: trunk/busybox/libbb/procps.c
===================================================================
--- trunk/busybox/libbb/procps.c	2007-09-28 22:07:23 UTC (rev 20103)
+++ trunk/busybox/libbb/procps.c	2007-09-28 22:13:55 UTC (rev 20104)
@@ -353,14 +353,10 @@
 
 #if 0 /* PSSCAN_CMD is not used */
 		if (flags & (PSSCAN_CMD|PSSCAN_ARGV0)) {
-			if (sp->argv0) {
-				free(sp->argv0);
-				sp->argv0 = NULL;
-			}
-			if (sp->cmd) {
-				free(sp->cmd);
-				sp->cmd = NULL;
-			}
+			free(sp->argv0);
+			sp->argv0 = NULL;
+			free(sp->cmd);
+			sp->cmd = NULL;
 			strcpy(filename_tail, "/cmdline");
 			/* TODO: to get rid of size limits, read into malloc buf,
 			 * then realloc it down to real size. */
@@ -380,10 +376,8 @@
 		}
 #else
 		if (flags & PSSCAN_ARGV0) {
-			if (sp->argv0) {
-				free(sp->argv0);
-				sp->argv0 = NULL;
-			}
+			free(sp->argv0);
+			sp->argv0 = NULL;
 			strcpy(filename_tail, "/cmdline");
 			n = read_to_buf(filename, buf);
 			if (n <= 0)




More information about the busybox-cvs mailing list