summaryrefslogtreecommitdiff
path: root/src/shared/cgroup-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/cgroup-util.c')
-rw-r--r--src/shared/cgroup-util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shared/cgroup-util.c b/src/shared/cgroup-util.c
index 06eb453d1a..9d50890adc 100644
--- a/src/shared/cgroup-util.c
+++ b/src/shared/cgroup-util.c
@@ -509,7 +509,7 @@ static int check_hierarchy(const char *p) {
assert(p);
/* Check if this controller actually really exists */
- cc = alloca(sizeof("/sys/fs/cgroup/") + strlen(p));
+ cc = alloca(strlen("/sys/fs/cgroup/") + strlen(p) + 1);
strcpy(stpcpy(cc, "/sys/fs/cgroup/"), p);
if (access(cc, F_OK) < 0)
return -errno;