X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fjoin.c;h=a6e8c9cb9e523a9290c0eae45580f2c0a09f4f5d;hb=3e7e0ba22d259f1c3753336ccb54aa7737a0e671;hp=d32fc1fe936c2f364965fa7a6fa1a31eb87c22e2;hpb=f15a63ac3f4a9be0e4989363814502e85bdaf495;p=wimlib diff --git a/src/join.c b/src/join.c index d32fc1fe..a6e8c9cb 100644 --- a/src/join.c +++ b/src/join.c @@ -329,14 +329,13 @@ WIMLIBAPI int wimlib_join(const char **swm_names, unsigned num_swms, goto out; ret = join_wims(swms, num_swms, joined_wim, write_flags); out: + /* out_fp is the same in all the swms and joined_wim. And it was + * already closed in the call to finish_write(). */ for (i = 0; i < num_swms; i++) { - /* out_fp is the same in all the swms and joined_wim; only close - * it one time, when freeing joined_wim. */ - if (swms[i]) { - swms[i]->out_fp = NULL; - wimlib_free(swms[i]); - } + swms[i]->out_fp = NULL; + wimlib_free(swms[i]); } + joined_wim->out_fp = NULL; wimlib_free(joined_wim); return ret; }