cgroup: fix potential bad memory access
authorLennart Poettering <lennart@poettering.net>
Thu, 3 Sep 2015 17:43:15 +0000 (19:43 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 4 Sep 2015 07:07:31 +0000 (09:07 +0200)
src/basic/cgroup-util.c

index bf897c9..77375f3 100644 (file)
@@ -518,9 +518,9 @@ int cg_get_path(const char *controller, const char *path, const char *suffix, ch
                 if (!path && !suffix)
                         return -EINVAL;
 
-                if (isempty(suffix))
+                if (!suffix)
                         t = strdup(path);
-                else if (isempty(path))
+                else if (!path)
                         t = strdup(suffix);
                 else
                         t = strjoin(path, "/", suffix, NULL);