]> wimlib.net Git - wimlib/blobdiff - src/wim.c
new_wim_struct(): Don't dereference NULL in out-of-memory case
[wimlib] / src / wim.c
index 3676123a9b58ce8c8149d9633eed68d5c0bee24a..e1cda332488c76d34284e51301c3f47465707e99 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;
 }