diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-09-03 19:43:15 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-09-04 09:07:31 +0200 |
commit | 989189eabf420690ca64d4713cea62e79c945d86 (patch) | |
tree | 828b54ff15e96fcad49d4dfc3d328a4835b13fac | |
parent | 9a66c87a2386468fd3adc250cd9003644a7a5e6b (diff) |
cgroup: fix potential bad memory access
-rw-r--r-- | src/basic/cgroup-util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c index bf897c9b2d..77375f3669 100644 --- a/src/basic/cgroup-util.c +++ b/src/basic/cgroup-util.c @@ -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); |