mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-07 16:59:08 +00:00
lxc_conf_init: make sure strdup succeeded
unlikely as a failure may be... Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
parent
2e599a6a25
commit
53f3f04845
@ -2135,6 +2135,11 @@ struct lxc_conf *lxc_conf_init(void)
|
|||||||
new->console.name[0] = '\0';
|
new->console.name[0] = '\0';
|
||||||
new->maincmd_fd = -1;
|
new->maincmd_fd = -1;
|
||||||
new->rootfs.mount = strdup(default_rootfs_mount);
|
new->rootfs.mount = strdup(default_rootfs_mount);
|
||||||
|
if (!new->rootfs.mount) {
|
||||||
|
ERROR("lxc_conf_init : %m");
|
||||||
|
free(new);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
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);
|
||||||
|
Loading…
Reference in New Issue
Block a user