[BusyBox-cvs] busybox/archival dpkg.c,1.67,1.68 gzip.c,1.57,1.58

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


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

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


Index: dpkg.c
===================================================================
RCS file: /var/cvs/busybox/archival/dpkg.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -r1.67 -r1.68
--- dpkg.c	6 Nov 2002 23:35:28 -0000	1.67
+++ dpkg.c	28 Nov 2002 11:27:22 -0000	1.68
@@ -491,13 +491,9 @@
 	unsigned short i;
 	if (node) {
 		for (i = 0; i < node->num_of_edges; i++) {
-			if (node->edge[i]) {
-				free(node->edge[i]);
-			}
-		}
-		if (node->edge) {
-			free(node->edge);
+			free(node->edge[i]);
 		}
+		free(node->edge);
 		free(node);
 	}
 }
@@ -571,12 +567,8 @@
 				break;
 		}
 fill_package_struct_cleanup:
-		if (field_name) {
-			free(field_name);
-		}
-		if (field_value) {
-			free(field_value);
-		}
+		free(field_name);
+		free(field_value);
 	}
 
 	if (new_node->version == search_name_hashtable("unknown")) {
@@ -880,9 +872,7 @@
 			fprintf(new_status_file, "%s\n\n", control_buffer);
 		}
 
-		if (status_from_file != NULL) {
-			free(status_from_file);
-		}
+		free(status_from_file);
 		free(package_name);
 		free(control_buffer);
 	}
@@ -1661,9 +1651,7 @@
 	free(deb_file);
 
 	for (i = 0; i < NAME_HASH_PRIME; i++) {
-		if (name_hashtable[i] != NULL) {
-			free(name_hashtable[i]);
-		}
+		free(name_hashtable[i]);
 	}
 
 	for (i = 0; i < PACKAGE_HASH_PRIME; i++) {
@@ -1673,9 +1661,7 @@
 	}
 
 	for (i = 0; i < STATUS_HASH_PRIME; i++) {
-		if (status_hashtable[i] != NULL) {
-			free(status_hashtable[i]);
-		}
+		free(status_hashtable[i]);
 	}
 
 	return(EXIT_SUCCESS);

Index: gzip.c
===================================================================
RCS file: /var/cvs/busybox/archival/gzip.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- gzip.c	28 Nov 2002 09:22:14 -0000	1.57
+++ gzip.c	28 Nov 2002 11:27:22 -0000	1.58
@@ -111,7 +111,7 @@
 #  define ALLOC(type, array, size) { \
       array = (type*)xcalloc((size_t)(((size)+1L)/2), 2*sizeof(type)); \
    }
-#  define FREE(array) {if (array != NULL) free(array), array=NULL;}
+#  define FREE(array) {free(array), array=NULL;}
 #else
 #  define DECLARE(type, array, size)  static type array[size]
 #  define ALLOC(type, array, size)




More information about the busybox-cvs mailing list