]> wimlib.net Git - wimlib/commitdiff
new_wim_struct(): Don't dereference NULL in out-of-memory case
authorEric Biggers <ebiggers3@gmail.com>
Fri, 1 Nov 2013 04:51:47 +0000 (23:51 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Fri, 1 Nov 2013 05:42:03 +0000 (00:42 -0500)
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;
 }