From: Christian Brauner Date: Wed, 27 Sep 2017 16:24:42 +0000 (+0200) Subject: cgfsng: check whether we have a conf X-Git-Tag: lxc-3.0.0.beta1~230^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b5396f9d55aa5a251bfeaba1cd4e97e3183f387;p=thirdparty%2Flxc.git cgfsng: check whether we have a conf We can't rely in general on the presence of an initialized conf on cgroup init time. One good example are our criu codepaths. Signed-off-by: Christian Brauner --- diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index ed391a616..897336f07 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -1175,8 +1175,10 @@ static void *cgfsng_init(struct lxc_handler *handler) d->name = must_copy_string(handler->name); /* copy per-container cgroup information */ - d->cgroup_meta.dir = must_copy_string(handler->conf->cgroup_meta.dir); - d->cgroup_meta.controllers = must_copy_string(handler->conf->cgroup_meta.controllers); + if (handler->conf) { + d->cgroup_meta.dir = must_copy_string(handler->conf->cgroup_meta.dir); + d->cgroup_meta.controllers = must_copy_string(handler->conf->cgroup_meta.controllers); + } /* copy system-wide cgroup information */ cgroup_pattern = lxc_global_config_value("lxc.cgroup.pattern");