diff options
Diffstat (limited to 'archival')
-rw-r--r-- | archival/dpkg.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/archival/dpkg.c b/archival/dpkg.c index 9f7818c..ebdf6c6 100644 --- a/archival/dpkg.c +++ b/archival/dpkg.c @@ -643,11 +643,9 @@ 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) { - package_hashtable[num] = new_node; - } else { - free_package(new_node); - } + if (package_hashtable[num] != NULL) + free_package(package_hashtable[num]); + package_hashtable[num] = new_node; return num; } |