diff options
Diffstat (limited to 'utils')
-rw-r--r-- | utils/hashmap.c | 5 |
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; } } |