mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-22 20:16:54 +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 (bucket = 0; bucket < hashmap->bucket_count; bucket++) {
|
||||||
for (entry = hashmap->buckets[bucket];
|
for (entry = hashmap->buckets[bucket];
|
||||||
entry != NULL;
|
entry != NULL;) {
|
||||||
entry = entry->next) {
|
hashmap_entry_t *next = entry->next;
|
||||||
hashmap->params->value_destroy(entry->value);
|
hashmap->params->value_destroy(entry->value);
|
||||||
hashmap->params->key_destroy(entry->key);
|
hashmap->params->key_destroy(entry->key);
|
||||||
free(entry);
|
free(entry);
|
||||||
|
entry = next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user