dpkg: free_package(NULL) is ok, so don't test for NULL, just free.
This commit is contained in:
parent
97fd6d81b4
commit
88a2aa98e0
@ -643,7 +643,6 @@ static unsigned fill_package_struct(char *control_buffer)
|
||||
return -1;
|
||||
}
|
||||
num = search_package_hashtable(new_node->name, new_node->version, VER_EQUAL);
|
||||
if (package_hashtable[num] != NULL)
|
||||
free_package(package_hashtable[num]);
|
||||
package_hashtable[num] = new_node;
|
||||
return num;
|
||||
@ -1739,10 +1738,8 @@ int dpkg_main(int argc, char **argv)
|
||||
}
|
||||
|
||||
for (i = 0; i < PACKAGE_HASH_PRIME; i++) {
|
||||
if (package_hashtable[i] != NULL) {
|
||||
free_package(package_hashtable[i]);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < STATUS_HASH_PRIME; i++) {
|
||||
free(status_hashtable[i]);
|
||||
|
Loading…
Reference in New Issue
Block a user