]> git.proxmox.com Git - mirror_lxc.git/commitdiff
coverity: #1435747
authorChristian Brauner <christian.brauner@ubuntu.com>
Sat, 26 May 2018 01:25:20 +0000 (03:25 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sat, 26 May 2018 01:29:32 +0000 (03:29 +0200)
Dereference before null check

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/cgroups/cgfsng.c

index 544772c61897b9f1a59f8b0b3c29ae6e041ab547..e7948b25b40f743c9c0c61fbaadff619e8ca017d 100644 (file)
@@ -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) {