X-Git-Url: https://pd.if.org/git/?p=nbds;a=blobdiff_plain;f=struct%2Fht.c;h=aed74fae86a2462e156e04cab4209d5d45145f05;hp=8703faa705085edeaa7bcc2e50a6eade2042e76e;hb=1da02238e784eaba7bc8193f62a738e9d3f3ee1a;hpb=053576b00e7d37f19ce99f033e9981761d647c1f diff --git a/struct/ht.c b/struct/ht.c index 8703faa..aed74fa 100644 --- a/struct/ht.c +++ b/struct/ht.c @@ -517,6 +517,12 @@ hash_table_t *ht_alloc (void) { void ht_free (hash_table_t *ht) { hash_table_i_t *hti = *ht; do { + for (uint32_t i = 0; i < (1 << hti->scale); ++i) { + assert(hti->table[i].value == COPIED_VALUE || !IS_TAGGED(hti->table[i].value)); + if (hti->table[i].key != DOES_NOT_EXIST) { + nbd_free((void *)(hti->table[i].key & MASK(48))); + } + } hash_table_i_t *next = hti->next; nbd_free(hti); hti = next;