[lxc-devel] [lxc/master] Fix memory leak in cgroup_exit

lifeng68 on Github lxc-bot at linuxcontainers.org
Thu Jan 17 09:36:38 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 397 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190117/179d5d8c/attachment.bin>
-------------- next part --------------
From 96a03c1f372a145bf170f38f903edadce7534ced Mon Sep 17 00:00:00 2001
From: LiFeng <lifeng68 at huawei.com>
Date: Thu, 17 Jan 2019 05:48:16 -0500
Subject: [PATCH] Fix memory leak in cgroup_exit

Add free memory pointed by struct cgroup_ops *ops

Signed-off-by: LiFeng <lifeng68 at huawei.com>
---
 src/lxc/cgroups/cgroup.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/lxc/cgroups/cgroup.c b/src/lxc/cgroups/cgroup.c
index ae65145d8..f0d4e1eff 100644
--- a/src/lxc/cgroups/cgroup.c
+++ b/src/lxc/cgroups/cgroup.c
@@ -96,6 +96,8 @@ void cgroup_exit(struct cgroup_ops *ops)
 	}
 	free(ops->hierarchies);
 
+	free(ops);
+
 	return;
 }
 


More information about the lxc-devel mailing list