]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc_conf_init: make sure strdup succeeded
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Mon, 1 Jul 2013 20:32:25 +0000 (15:32 -0500)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Mon, 1 Jul 2013 20:32:25 +0000 (15:32 -0500)
unlikely as a failure may be...

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/conf.c

index a98fbefb61fecf34362567a17906e06d73dc6bb5..37c0cb4dd05c4f99933a374fbf7e8716aaf37540 100644 (file)
@@ -2135,6 +2135,11 @@ struct lxc_conf *lxc_conf_init(void)
        new->console.name[0] = '\0';
        new->maincmd_fd = -1;
        new->rootfs.mount = strdup(default_rootfs_mount);
+       if (!new->rootfs.mount) {
+               ERROR("lxc_conf_init : %m");
+               free(new);
+               return NULL;
+       }
        new->kmsg = 1;
        lxc_list_init(&new->cgroup);
        lxc_list_init(&new->network);