From 9b5396f9d55aa5a251bfeaba1cd4e97e3183f387 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Wed, 27 Sep 2017 18:24:42 +0200 Subject: [PATCH] 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 --- src/lxc/cgroups/cgfsng.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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"); -- 2.47.2