From: Lennart Poettering Date: Thu, 3 Sep 2015 17:43:15 +0000 (+0200) Subject: cgroup: fix potential bad memory access X-Git-Tag: v226~31^2~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=989189eabf420690ca64d4713cea62e79c945d86;p=thirdparty%2Fsystemd.git cgroup: fix potential bad memory access --- diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c index bf897c9b2dc..77375f36695 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);