X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Flookup_table.c;h=9502db4770b110b873a7f574ecca6564a2021132;hp=064215ec0cf75529de50fe677ea758dbdd2fff5b;hb=9e2571b03cd9c71d11b3dad9ea5dcfa43f50deb4;hpb=9024010515ca562dd8730d4ca846b5335ff6e48a diff --git a/src/lookup_table.c b/src/lookup_table.c index 064215ec..9502db47 100644 --- a/src/lookup_table.c +++ b/src/lookup_table.c @@ -40,7 +40,7 @@ new_lookup_table(size_t capacity) struct wim_lookup_table *table; struct hlist_head *array; - table = MALLOC(sizeof(struct wim_lookup_table)); + table = CALLOC(1, sizeof(struct wim_lookup_table)); if (table) { array = CALLOC(capacity, sizeof(array[0])); if (array) { @@ -920,3 +920,13 @@ lookup_table_total_stream_size(struct wim_lookup_table *table) for_lookup_table_entry(table, lte_add_stream_size, &total_size); return total_size; } + +void +lookup_table_free_unhashed_streams(struct wim_lookup_table *table) +{ + struct wim_lookup_table_entry *lte, *tmp; + + list_for_each_entry_safe(lte, tmp, table->unhashed_streams, staging_list) + free_lookup_table_entry(lte); + INIT_LIST_HEAD(table->unhashed_streams); +}