From: Christian Brauner Date: Sat, 17 Feb 2018 18:26:42 +0000 (+0100) Subject: cgfsng: remove_path_for_hierarchy() X-Git-Tag: lxc-2.0.10~284 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77a3a03e7d2e79b4624636a7424e6b4a6b3497cb;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 d15990441..ca025268f 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -1736,8 +1736,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; }