- /* Free the dentry tree, any lookup table entries that have their
- * refcnt decremented to 0, and the security data. */
- destroy_image_metadata(&w->image_metadata[image - 1], w->lookup_table);
+ /* Unless the image metadata is shared by another WIMStruct, free the
+ * dentry tree, any lookup table entries that have their refcnt
+ * decremented to 0, and the security data. */
+ put_image_metadata(wim->image_metadata[image - 1], wim->lookup_table);