diff --git a/src/dict.c b/src/dict.c index 1a3e321..188c840 100644 --- a/src/dict.c +++ b/src/dict.c @@ -76,13 +76,19 @@ static int bucket_each_slot(int level, patty_dict_bucket *bucket, patty_dict_cal } if (slot->next) { - return bucket_each_slot(level+1, (patty_dict_bucket *)slot->next, callback, ctx); + if (bucket_each_slot(level+1, + (patty_dict_bucket *)slot->next, + callback, + ctx) < 0) { + goto error_next_slot; + } } } return 0; error_callback: +error_next_slot: return -1; }