Skip to content

Commit

Permalink
fix: kid_hashmap_free unsafe foreach
Browse files Browse the repository at this point in the history
  • Loading branch information
hsiaosiyuan0 committed Dec 9, 2023
1 parent b4b3861 commit f6e6be2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/kid.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ void kid_hashmap_del(KidHashmap *map, KidHashkey *key) {
void kid_hashmap_free(KidHashmap *map) {
struct KidListHead *el, *el1;
if (map->key_free) {
kid_list_for_each(el, &map->keys) {
kid_list_for_each_safe(el, el1, &map->keys) {
KidHashkey *k = kid_list_entry(el, KidHashkey, link);
map->key_free(k);
}
Expand Down

0 comments on commit f6e6be2

Please sign in to comment.