X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fextract.c;h=9cbac117f54438d25372c90cb43dd4df4c327bb5;hp=a1725a918880b84e79e088815fb0518ecbc54583;hb=e10a0fd1f906c342b0b45bc393ec10043c6a8936;hpb=8f76d8e5c6132dd296c36f97aabb011a04e944ae diff --git a/src/extract.c b/src/extract.c index a1725a91..9cbac117 100644 --- a/src/extract.c +++ b/src/extract.c @@ -1658,17 +1658,11 @@ dentry_reset_extraction_list_node(struct wim_dentry *dentry) dentry->extraction_list = (struct list_head){NULL, NULL}; } -static void -dentry_delete_from_list(struct wim_dentry *dentry) +static int +dentry_delete_from_list(struct wim_dentry *dentry, void *_ignore) { list_del(&dentry->extraction_list); dentry_reset_extraction_list_node(dentry); -} - -static int -do_dentry_delete_from_list(struct wim_dentry *dentry, void *_ignore) -{ - dentry_delete_from_list(dentry); return 0; } @@ -1885,7 +1879,7 @@ out_replace: return 0; skip_dentry: - for_dentry_in_tree(dentry, do_dentry_delete_from_list, NULL); + for_dentry_in_tree(dentry, dentry_delete_from_list, NULL); return 0; } @@ -2490,7 +2484,7 @@ extract_trees(WIMStruct *wim, struct wim_dentry **trees, size_t num_trees, * volume. */ ret = ctx.ops->start_extract(target, &ctx); if (ret) - return ret; + goto out_destroy_dentry_list; /* Get and check the features required to extract the dentries. */ dentry_list_get_features(&dentry_list, &required_features); @@ -2506,12 +2500,12 @@ extract_trees(WIMStruct *wim, struct wim_dentry **trees, size_t num_trees, * can't be extracted due to naming problems. */ ret = dentry_list_calculate_extraction_names(&dentry_list, &ctx); if (ret) - goto out_destroy_dentry_list; + goto out_finish_or_abort_extract; /* Build list of streams to extract. */ ret = dentry_list_resolve_streams(&dentry_list, &ctx); if (ret) - goto out_destroy_dentry_list; + goto out_finish_or_abort_extract; INIT_LIST_HEAD(&ctx.stream_list); ret = dentry_list_ref_streams(&dentry_list, &ctx); if (ret) @@ -2677,8 +2671,6 @@ out_free_realtarget: out_destroy_stream_list: if (!(ctx.extract_flags & WIMLIB_EXTRACT_FLAG_FILE_ORDER)) destroy_stream_list(&ctx.stream_list); -out_destroy_dentry_list: - destroy_dentry_list(&dentry_list); out_finish_or_abort_extract: if (ret) { if (ctx.ops->abort_extract) @@ -2687,6 +2679,8 @@ out_finish_or_abort_extract: if (ctx.ops->finish_extract) ret = ctx.ops->finish_extract(&ctx); } +out_destroy_dentry_list: + destroy_dentry_list(&dentry_list); return ret; }