diff options
| author | Mosder <xmosder12@gmail.com> | 2026-07-22 01:34:42 +0200 |
|---|---|---|
| committer | Mosder <xmosder12@gmail.com> | 2026-07-22 01:34:42 +0200 |
| commit | 196a30821dd1d3459807ed7ad1f45ceda1fa5585 (patch) | |
| tree | c2ad24457847ad322b214de7bd6ae9e749445edc | |
| parent | 5d463a7f4c721629a1996be6d19634338290a539 (diff) | |
fix: fixed wrong arguments in cleanup functions of hashmap
| -rw-r--r-- | analyzer/structures/hashmap.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/analyzer/structures/hashmap.c b/analyzer/structures/hashmap.c index 7a38852..84cc289 100644 --- a/analyzer/structures/hashmap.c +++ b/analyzer/structures/hashmap.c @@ -33,7 +33,7 @@ void hashmap_put(HashMap *map, void *key, void *value) { if (map->compare(key, node->key)) { // ensure no hanging memory allocation if (map->value_cleanup) { - map->value_cleanup(node); + map->value_cleanup(node->value); } memcpy(node->value, value, map->value_size); return; @@ -72,10 +72,10 @@ void *hashmap_get(HashMap *map, void *key) { void free_node_without_next(HashMap *map, HashMapNode *node) { if (map->key_cleanup) { - map->key_cleanup(node); + map->key_cleanup(node->key); } if (map->value_cleanup) { - map->value_cleanup(node); + map->value_cleanup(node->value); } free(node->key); free(node->value); |
