cgroup: fix potential bad memory access
This commit is contained in:
parent
9a66c87a23
commit
989189eabf
|
@ -518,9 +518,9 @@ int cg_get_path(const char *controller, const char *path, const char *suffix, ch
|
||||||
if (!path && !suffix)
|
if (!path && !suffix)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if (isempty(suffix))
|
if (!suffix)
|
||||||
t = strdup(path);
|
t = strdup(path);
|
||||||
else if (isempty(path))
|
else if (!path)
|
||||||
t = strdup(suffix);
|
t = strdup(suffix);
|
||||||
else
|
else
|
||||||
t = strjoin(path, "/", suffix, NULL);
|
t = strjoin(path, "/", suffix, NULL);
|
||||||
|
|
Loading…
Reference in a new issue