]> wimlib.net Git - wimlib/blobdiff - src/join.c
Close out_fp in finish_write()
[wimlib] / src / join.c
index d32fc1fe936c2f364965fa7a6fa1a31eb87c22e2..a6e8c9cb9e523a9290c0eae45580f2c0a09f4f5d 100644 (file)
@@ -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;
 }