summaryrefslogtreecommitdiff
path: root/utils/hashmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils/hashmap.c')
-rw-r--r--utils/hashmap.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/utils/hashmap.c b/utils/hashmap.c
index bfbf6ceb8..b7870a3a7 100644
--- a/utils/hashmap.c
+++ b/utils/hashmap.c
@@ -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;
}
}