mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-22 12:12:35 +03:00
utils: Fix destroy of non-empty hashmap
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
parent
54b1960d18
commit
3e02961ec8
@ -85,11 +85,12 @@ hashmap_destroy(hashmap_t *hashmap)
|
||||
|
||||
for (bucket = 0; bucket < hashmap->bucket_count; bucket++) {
|
||||
for (entry = hashmap->buckets[bucket];
|
||||
entry != NULL;
|
||||
entry = entry->next) {
|
||||
entry != NULL;) {
|
||||
hashmap_entry_t *next = entry->next;
|
||||
hashmap->params->value_destroy(entry->value);
|
||||
hashmap->params->key_destroy(entry->key);
|
||||
free(entry);
|
||||
entry = next;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user