]> wimlib.net Git - wimlib/blobdiff - src/wim.c
wimoptimize: make --recompress-slow imply --compress=maximum
[wimlib] / src / wim.c
index 3676123a9b58ce8c8149d9633eed68d5c0bee24a..2a6ac129d644eb4b437544171e117f25f81cc00a 100644 (file)
--- a/src/wim.c
+++ b/src/wim.c
@@ -70,8 +70,8 @@ new_wim_struct(void)
        if (wim) {
                wim->in_fd.fd = -1;
                wim->out_fd.fd = -1;
+               INIT_LIST_HEAD(&wim->subwims);
        }
-       INIT_LIST_HEAD(&wim->subwims);
        return wim;
 }
 
@@ -139,6 +139,7 @@ wimlib_create_new_wim(int ctype, WIMStruct **wim_ret)
        wim->lookup_table = table;
        wim->refcnts_ok = 1;
        wim->compression_type = ctype;
+       wim->out_compression_type = ctype;
        *wim_ret = wim;
        return 0;
 out_free:
@@ -482,6 +483,7 @@ begin_read(WIMStruct *wim, const void *wim_filename_or_fd,
        } else {
                wim->compression_type = WIMLIB_COMPRESSION_TYPE_NONE;
        }
+       wim->out_compression_type = wim->compression_type;
 
        if (open_flags & WIMLIB_OPEN_FLAG_CHECK_INTEGRITY) {
                ret = check_wim_integrity(wim, progress_func);
@@ -775,6 +777,7 @@ wimlib_free(WIMStruct *wim)
        if (filedes_valid(&wim->out_fd))
                filedes_close(&wim->out_fd);
 
+       wimlib_lzx_free_context(wim->lzx_context);
 
        free_lookup_table(wim->lookup_table);