From: Christian Brauner Date: Sat, 17 Feb 2018 18:26:42 +0000 (+0100) Subject: cgfsng: remove_path_for_hierarchy() X-Git-Tag: lxc-3.0.0.beta1~22^2~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e56639fb06bd1d7845b6a6cab2543a0b81260ac9;p=thirdparty%2Flxc.git cgfsng: remove_path_for_hierarchy() Signed-off-by: Christian Brauner --- diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index 8bb717fff..5f53aee03 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -1755,8 +1755,12 @@ static bool create_path_for_hierarchy(struct hierarchy *h, char *cgname) static void remove_path_for_hierarchy(struct hierarchy *h, char *cgname) { - if (rmdir(h->fullcgpath) < 0) - SYSERROR("Failed to clean up cgroup %s from failed creation attempt", h->fullcgpath); + int ret; + + ret = rmdir(h->fullcgpath); + if (ret < 0) + SYSERROR("Failed to rmdir(\"%s\") from failed creation attempt", h->fullcgpath); + free(h->fullcgpath); h->fullcgpath = NULL; }