]> wimlib.net Git - wimlib/blobdiff - src/lookup_table.c
read_wim_lookup_table(): Fix error paths
[wimlib] / src / lookup_table.c
index f54f0cc675e0de4dc3d4db1e06eaf5296b78a2ce..ca7d8b5e340c0782663f8c65eef03469d08486e9 100644 (file)
@@ -323,7 +323,6 @@ for_lookup_table_entry(struct wim_lookup_table *table,
                hlist_for_each_entry_safe(lte, pos, tmp, &table->array[i],
                                          hash_list)
                {
-                       wimlib_assert2(!(lte->resource_entry.flags & WIM_RESHDR_FLAG_METADATA));
                        ret = visitor(lte, arg);
                        if (ret)
                                return ret;
@@ -657,7 +656,9 @@ read_wim_lookup_table(WIMStruct *wim)
                         * resource.  */
                        struct wim_lookup_table_entry *prev_entry = NULL;
 
-                       if (back_to_back_pack) {
+                       if (back_to_back_pack &&
+                           !list_empty(&cur_rspec->stream_list))
+                       {
                                prev_entry = list_entry(cur_rspec->stream_list.prev,
                                                        struct wim_lookup_table_entry,
                                                        rspec_node);
@@ -843,7 +844,7 @@ read_wim_lookup_table(WIMStruct *wim)
        goto out_free_buf;
 
 out_free_cur_entry:
-       FREE(cur_entry);
+       free_lookup_table_entry(cur_entry);
 out_free_lookup_table:
        free_lookup_table(table);
 out_free_buf:
@@ -869,8 +870,7 @@ write_wim_lookup_table_from_stream_list(struct list_head *stream_list,
                                        struct filedes *out_fd,
                                        u16 part_number,
                                        struct wim_reshdr *out_reshdr,
-                                       int write_resource_flags,
-                                       struct wimlib_lzx_context **comp_ctx)
+                                       int write_resource_flags)
 {
        size_t table_size;
        struct wim_lookup_table_entry *lte;
@@ -950,8 +950,7 @@ write_wim_lookup_table_from_stream_list(struct list_head *stream_list,
                                             0,
                                             out_reshdr,
                                             NULL,
-                                            write_resource_flags,
-                                            comp_ctx);
+                                            write_resource_flags);
        FREE(table_buf);
        DEBUG("ret=%d", ret);
        return ret;
@@ -1177,7 +1176,7 @@ wim_pathname_to_stream(WIMStruct *wim,
                }
        }
 
-       dentry = get_dentry(wim, path);
+       dentry = get_dentry(wim, path, WIMLIB_CASE_SENSITIVE);
        if (p)
                *p = T(':');
        if (!dentry)