Commit 54c30e29 by Serge Hallyn

conf.c: always strdup rootfs.mount

The reason is that the generic code which handles reading lxc.rootfs.mount always frees the old value if not NULL. So without this setting lxc.rootfs.mount = /mnt causes segfault. Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
parent 37903589
...@@ -2134,7 +2134,7 @@ struct lxc_conf *lxc_conf_init(void) ...@@ -2134,7 +2134,7 @@ struct lxc_conf *lxc_conf_init(void)
new->console.slave = -1; new->console.slave = -1;
new->console.name[0] = '\0'; new->console.name[0] = '\0';
new->maincmd_fd = -1; new->maincmd_fd = -1;
new->rootfs.mount = default_rootfs_mount; new->rootfs.mount = strdup(default_rootfs_mount);
new->kmsg = 1; new->kmsg = 1;
lxc_list_init(&new->cgroup); lxc_list_init(&new->cgroup);
lxc_list_init(&new->network); lxc_list_init(&new->network);
...@@ -3152,7 +3152,7 @@ void lxc_conf_free(struct lxc_conf *conf) ...@@ -3152,7 +3152,7 @@ void lxc_conf_free(struct lxc_conf *conf)
return; return;
if (conf->console.path) if (conf->console.path)
free(conf->console.path); free(conf->console.path);
if (conf->rootfs.mount != default_rootfs_mount) if (conf->rootfs.mount)
free(conf->rootfs.mount); free(conf->rootfs.mount);
if (conf->rootfs.path) if (conf->rootfs.path)
free(conf->rootfs.path); free(conf->rootfs.path);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment