From: Serge Hallyn Date: Mon, 1 Jul 2013 20:32:25 +0000 (-0500) Subject: lxc_conf_init: make sure strdup succeeded X-Git-Tag: lxc-1.0.0.alpha1~1^2~143 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53f3f04845a9eb60064c302e1f95652f665809f1;p=thirdparty%2Flxc.git lxc_conf_init: make sure strdup succeeded unlikely as a failure may be... Signed-off-by: Serge Hallyn --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index a98fbefb6..37c0cb4dd 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -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);