cgroup: fix potential bad memory access

This commit is contained in:
Lennart Poettering 2015-09-03 19:43:15 +02:00
parent 9a66c87a23
commit 989189eabf
1 changed files with 2 additions and 2 deletions

View 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);