Quoting Christian Seiler (christ...@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.hal...@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


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel

Reply via email to