]> wimlib.net Git - wimlib/blobdiff - src/lookup_table.c
inode_fixup.c: Only warn when inconsistent inode detected
[wimlib] / src / lookup_table.c
index c76823d14e4cacc3b4be3f620a14cadcb9dd13ec..098a8aaf194b2dce63a15b97b7127d48e6814c72 100644 (file)
@@ -190,41 +190,47 @@ out_free:
 }
 
 void
-free_lookup_table_entry(struct wim_lookup_table_entry *lte)
+lte_put_resource(struct wim_lookup_table_entry *lte)
 {
-       if (lte) {
-               switch (lte->resource_location) {
-               case RESOURCE_IN_WIM:
-                       list_del(&lte->rspec_node);
-                       if (list_empty(&lte->rspec->stream_list))
-                               FREE(lte->rspec);
-                       break;
-               case RESOURCE_IN_FILE_ON_DISK:
-       #ifdef __WIN32__
-               case RESOURCE_WIN32_ENCRYPTED:
-       #endif
-       #ifdef WITH_FUSE
-               case RESOURCE_IN_STAGING_FILE:
-                       BUILD_BUG_ON((void*)&lte->file_on_disk !=
-                                    (void*)&lte->staging_file_name);
-       #endif
-               case RESOURCE_IN_ATTACHED_BUFFER:
-                       BUILD_BUG_ON((void*)&lte->file_on_disk !=
-                                    (void*)&lte->attached_buffer);
-                       FREE(lte->file_on_disk);
-                       break;
-#ifdef WITH_NTFS_3G
-               case RESOURCE_IN_NTFS_VOLUME:
-                       if (lte->ntfs_loc) {
-                               FREE(lte->ntfs_loc->path);
-                               FREE(lte->ntfs_loc->stream_name);
-                               FREE(lte->ntfs_loc);
-                       }
-                       break;
+       switch (lte->resource_location) {
+       case RESOURCE_IN_WIM:
+               list_del(&lte->rspec_node);
+               if (list_empty(&lte->rspec->stream_list))
+                       FREE(lte->rspec);
+               break;
+       case RESOURCE_IN_FILE_ON_DISK:
+#ifdef __WIN32__
+       case RESOURCE_WIN32_ENCRYPTED:
 #endif
-               default:
-                       break;
+#ifdef WITH_FUSE
+       case RESOURCE_IN_STAGING_FILE:
+               BUILD_BUG_ON((void*)&lte->file_on_disk !=
+                            (void*)&lte->staging_file_name);
+#endif
+       case RESOURCE_IN_ATTACHED_BUFFER:
+               BUILD_BUG_ON((void*)&lte->file_on_disk !=
+                            (void*)&lte->attached_buffer);
+               FREE(lte->file_on_disk);
+               break;
+#ifdef WITH_NTFS_3G
+       case RESOURCE_IN_NTFS_VOLUME:
+               if (lte->ntfs_loc) {
+                       FREE(lte->ntfs_loc->path);
+                       FREE(lte->ntfs_loc->stream_name);
+                       FREE(lte->ntfs_loc);
                }
+               break;
+#endif
+       default:
+               break;
+       }
+}
+
+void
+free_lookup_table_entry(struct wim_lookup_table_entry *lte)
+{
+       if (lte) {
+               lte_put_resource(lte);
                FREE(lte);
        }
 }
@@ -1181,6 +1187,9 @@ wimlib_iterate_lookup_table(WIMStruct *wim, int flags,
                            wimlib_iterate_lookup_table_callback_t cb,
                            void *user_ctx)
 {
+       if (flags != 0)
+               return WIMLIB_ERR_INVALID_PARAM;
+
        struct iterate_lte_context ctx = {
                .cb = cb,
                .user_ctx = user_ctx,