From 3ec12d39cda560d4054887d8755cdbe94d8c5c86 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Sat, 26 May 2018 03:25:20 +0200 Subject: [PATCH] coverity: #1435747 Dereference before null check Signed-off-by: Christian Brauner --- src/lxc/cgroups/cgfsng.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index 544772c61..e7948b25b 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -1284,7 +1284,6 @@ static inline bool cgfsng_create(struct cgroup_ops *ops, char *container_cgroup, *offset, *tmp; int idx = 0; struct lxc_conf *conf = handler->conf; - const char *join_args[] = {conf->cgroup_meta.dir, handler->name, NULL}; if (ops->container_cgroup) { WARN("cgfsng_create called a second time: %s", ops->container_cgroup); @@ -1295,7 +1294,7 @@ static inline bool cgfsng_create(struct cgroup_ops *ops, return false; if (conf->cgroup_meta.dir) - tmp = lxc_string_join("/", join_args, false); + tmp = lxc_string_join("/", (const char *[]){conf->cgroup_meta.dir, handler->name, NULL}, false); else tmp = lxc_string_replace("%n", handler->name, ops->cgroup_pattern); if (!tmp) { -- 2.47.2