diff options
author | Aaron Lehmann <aaronl@vitelius.com> | 2002-11-28 14:27:31 +0300 |
---|---|---|
committer | Aaron Lehmann <aaronl@vitelius.com> | 2002-11-28 14:27:31 +0300 |
commit | a170e1c858d35c474ceb9fecb41b37d681424094 (patch) | |
tree | cda2b13f10ca1ab0a3559d4b6ff663ed20d7106c /archival/dpkg.c | |
parent | 1652855fbc830f41c7ee56ece1a30b328c4fb395 (diff) |
Change if(x)free(x); to free(x);
Diffstat (limited to 'archival/dpkg.c')
-rw-r--r-- | archival/dpkg.c | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/archival/dpkg.c b/archival/dpkg.c index 8b25bace3..23509fcb5 100644 --- a/archival/dpkg.c +++ b/archival/dpkg.c @@ -491,13 +491,9 @@ void free_package(common_node_t *node) 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 @@ unsigned int fill_package_struct(char *control_buffer) 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 @@ void write_status_file(deb_file_t **deb_file) 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 @@ int dpkg_main(int argc, char **argv) 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 @@ int dpkg_main(int argc, char **argv) } for (i = 0; i < STATUS_HASH_PRIME; i++) { - if (status_hashtable[i] != NULL) { - free(status_hashtable[i]); - } + free(status_hashtable[i]); } return(EXIT_SUCCESS); |