The following commit has been merged in the master branch: commit 1b9482b927b7b8518e2ebd980e9bfb8ad571a74c Author: Simon Wunderlich siwu@hrz.tu-chemnitz.de Date: Tue Mar 13 15:50:02 2007 +0100
- fix bug in hash_delete() (remove actual bucket, not the first one)
diff --git a/hash.c b/hash.c index da09301..c72a7ea 100644 --- a/hash.c +++ b/hash.c @@ -46,7 +46,7 @@ void hash_delete(struct hashtable_t *hash, hashdata_free_cb free_cb) {
bucket= hash->table[i].next; while (bucket != NULL) { - if (free_cb!=NULL) free_cb( hash->table[i].data ); + if (free_cb!=NULL) free_cb( bucket->data ); last_bucket= bucket; bucket= bucket->next; debugFree(last_bucket, 1301);