[BusyBox-cvs] busybox/util-linux fsck_minix.c,1.35,1.36 getopt.c,1.10,1.11 umount.c,1.58,1.59

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


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

Modified Files:
	fsck_minix.c getopt.c umount.c 
Log Message:
Change if(x)free(x); to free(x);


Index: fsck_minix.c
===================================================================
RCS file: /var/cvs/busybox/util-linux/fsck_minix.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- fsck_minix.c	24 Oct 2001 05:00:29 -0000	1.35
+++ fsck_minix.c	28 Nov 2002 11:27:31 -0000	1.36
@@ -1314,9 +1314,7 @@
 
 	if (name_list) { 
 		for (i = 0; i < MAX_DEPTH; i++) {
-			if (name_list[i]) {
-				free(name_list[i]);
-			}
+			free(name_list[i]);
 		}
 		free(name_list);
 	}

Index: getopt.c
===================================================================
RCS file: /var/cvs/busybox/util-linux/getopt.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- getopt.c	19 Jul 2002 00:05:54 -0000	1.10
+++ getopt.c	28 Nov 2002 11:27:31 -0000	1.11
@@ -92,8 +92,7 @@
         const char *argptr=arg;
         char *bufptr;
 
-        if (BUFFER != NULL)
-                free(BUFFER);
+        free(BUFFER);
 
         if (!quote) { /* Just copy arg */
                BUFFER=xstrdup(arg);
@@ -340,16 +339,14 @@
                         alternative=1;
                         break;
                 case 'o':
-                        if (optstr)
-                                free(optstr);
+                       free(optstr);
                        optstr=xstrdup(optarg);
                         break;
                 case 'l':
                         add_long_options(optarg);
                         break;
                 case 'n':
-                        if (name)
-                                free(name);
+                       free(name);
                        name=xstrdup(optarg);
                         break;
                 case 'q':

Index: umount.c
===================================================================
RCS file: /var/cvs/busybox/util-linux/umount.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- umount.c	20 Dec 2001 23:13:26 -0000	1.58
+++ umount.c	28 Nov 2002 11:27:31 -0000	1.59
@@ -158,10 +158,8 @@
 	this = mtab_cache;
 	while (this) {
 		next = this->next;
-		if (this->device)
-			free(this->device);
-		if (this->mountpt)
-			free(this->mountpt);
+		free(this->device);
+		free(this->mountpt);
 		free(this);
 		this = next;
 	}




More information about the busybox-cvs mailing list