[lxc-devel] [lxc/lxc] b65330: split up lxc_cgroup_load_meta2

Serge Hallyn serge.hallyn at ubuntu.com
Wed Sep 25 20:25:29 UTC 2013


Quoting Christian Seiler (christian at iwakd.de):
> Hi there,
> 
> > The result seems easier to reason about.
> 
> I agree, thanks!
> 
> >  A question I had, is, should
> > the kernel_subsystems ** be freed in the success case?  I assumed it 
> > was
> > being used elsewhere but I can't find where.  Currently it is only 
> > being
> > freed in the error case.  I suspect we want to free it in the success
> > case as well.
> 
> Yes, I agree completely. Sorry I didn't notice that when writing
> the function.

Thanks.  I pushed the following commit to github:

[PATCH 1/1] free kernel_subsystems in success case

Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
---
 src/lxc/cgroup.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/lxc/cgroup.c b/src/lxc/cgroup.c
index babe0b7..e27bc03 100644
--- a/src/lxc/cgroup.c
+++ b/src/lxc/cgroup.c
@@ -451,6 +451,7 @@ struct cgroup_meta_data *lxc_cgroup_load_meta2(const char **subsystem_whitelist)
 		goto out_error;
 	}
 
+	lxc_free_array((void **)kernel_subsystems, free);
 	return meta_data;
 
 out_error:
-- 
1.8.1.2





More information about the lxc-devel mailing list