From: Christian Brauner Date: Sat, 26 May 2018 01:25:20 +0000 (+0200) Subject: coverity: #1435747 X-Git-Tag: lxc-3.1.0~286^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ec12d39cda560d4054887d8755cdbe94d8c5c86;p=thirdparty%2Flxc.git coverity: #1435747 Dereference before null check Signed-off-by: Christian Brauner --- 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) {