The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/3250
This e-mail was sent by the LXC bot, direct replies will not reach the author unless they happen to be subscribed to this list. === Description (from pull-request) === Signed-off-by: LiFeng <lifen...@huawei.com>
From e2a8c0c360d525d33ef15f1a88605234ff3daf7a Mon Sep 17 00:00:00 2001 From: LiFeng <lifen...@huawei.com> Date: Tue, 14 Jan 2020 04:17:13 -0500 Subject: [PATCH] cgroup.c: fix memory leak at cgroup init failed Signed-off-by: LiFeng <lifen...@huawei.com> --- src/lxc/cgroups/cgroup.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lxc/cgroups/cgroup.c b/src/lxc/cgroups/cgroup.c index 11d14d27c4..2e9670e3b1 100644 --- a/src/lxc/cgroups/cgroup.c +++ b/src/lxc/cgroups/cgroup.c @@ -31,9 +31,11 @@ struct cgroup_ops *cgroup_init(struct lxc_conf *conf) if (!cgroup_ops) return log_error_errno(NULL, errno, "Failed to initialize cgroup driver"); - if (cgroup_ops->data_init(cgroup_ops)) + if (cgroup_ops->data_init(cgroup_ops)) { + cgroup_exit(cgroup_ops); return log_error_errno(NULL, errno, "Failed to initialize cgroup data"); + } TRACE("Initialized cgroup driver %s", cgroup_ops->driver);
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel