Fix stuuuuuupid leak in hash_clean.

This commit is contained in:
Arnaud Cornet 2007-12-29 18:15:03 +01:00
parent b020e895a8
commit 95618a06ab
1 changed files with 6 additions and 2 deletions

View File

@ -463,9 +463,13 @@ void hash_init(hash_t *h, int options)
void hash_clean(hash_t *h)
{
int i;
hash_item_t *hi;
for (i = 0; i < 256; i++) {
while (list_remove_first(&h->lists[i]))
;
while ((hi = list_remove_first(&h->lists[i]))) {
free(hi->key);
free(hi);
}
}
}