From: Christian Brauner Date: Sat, 30 Jan 2021 11:00:28 +0000 (+0100) Subject: cgroups: use cleanup macro for consistency X-Git-Tag: lxc-5.0.0~312^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0450b7ce718ef9fbc2f0c606b55589a6de911889;p=thirdparty%2Flxc.git cgroups: use cleanup macro for consistency and to prevent future mishaps. Signed-off-by: Christian Brauner --- diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index beb277a39..8872163d5 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -3338,8 +3338,8 @@ static int cg_unified_init(struct cgroup_ops *ops, bool relative, __do_close int cgroup_root_fd = -EBADF; __do_free char *base_cgroup = NULL, *controllers_path = NULL; __do_free_string_list char **delegatable; + __do_free struct hierarchy *new = NULL; int ret; - struct hierarchy *new; ret = unified_cgroup_hierarchy(); if (ret == -ENOMEDIUM) @@ -3393,7 +3393,7 @@ static int cg_unified_init(struct cgroup_ops *ops, bool relative, new->bpf_device_controller = 1; ops->cgroup_layout = CGROUP_LAYOUT_UNIFIED; - ops->unified = new; + ops->unified = move_ptr(new); return CGROUP2_SUPER_MAGIC; }