[lxc-devel] [PATCH 2/5] attach: Fix minor memory leak in environment variable handling

Serge Hallyn serge.hallyn at ubuntu.com
Mon Aug 19 14:16:17 UTC 2013


Quoting Christian Seiler (christian at iwakd.de):
> Signed-off-by: Christian Seiler <christian at iwakd.de>

Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>

> ---
>  src/lxc/attach.c |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/src/lxc/attach.c b/src/lxc/attach.c
> index 950fe9a..2e94b70 100644
> --- a/src/lxc/attach.c
> +++ b/src/lxc/attach.c
> @@ -292,7 +292,13 @@ int lxc_attach_set_environment(enum lxc_attach_env_policy_t policy, char** extra
>  		}
>  
>  		if (clearenv()) {
> +			char **p;
>  			SYSERROR("failed to clear environment");
> +			if (extra_keep_store) {
> +				for (p = extra_keep_store; *p; p++)
> +					free(*p);
> +				free(extra_keep_store);
> +			}
>  			return -1;
>  		}
>  
> -- 
> 1.7.10.4
> 
> 
> ------------------------------------------------------------------------------
> Get 100% visibility into Java/.NET code with AppDynamics Lite!
> It's a free troubleshooting tool designed for production.
> Get down to code-level detail for bottlenecks, with <2% overhead. 
> Download for free and get started troubleshooting in minutes. 
> http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
> _______________________________________________
> Lxc-devel mailing list
> Lxc-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-devel




More information about the lxc-devel mailing list