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 3676123..e1cda33 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;
        if (wim) {
                wim->in_fd.fd = -1;
                wim->out_fd.fd = -1;
+               INIT_LIST_HEAD(&wim->subwims);
        }
        }
-       INIT_LIST_HEAD(&wim->subwims);
        return wim;
 }
 
        return wim;
 }