[lxc-devel] [PATCH] call lxc_container_put when needed in lxc_destroy.c

Serge Hallyn serge.hallyn at ubuntu.com
Sat Oct 19 14:48:42 UTC 2013


Quoting S.Çağlar Onur (caglar at 10ur.org):
> Signed-off-by: S.Çağlar Onur <caglar at 10ur.org>

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

> ---
>  src/lxc/lxc_destroy.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/src/lxc/lxc_destroy.c b/src/lxc/lxc_destroy.c
> index 9983241..1d1e687 100644
> --- a/src/lxc/lxc_destroy.c
> +++ b/src/lxc/lxc_destroy.c
> @@ -108,5 +108,12 @@ int main(int argc, char *argv[])
>  		c->stop(c);
>  	}
>  
> -	exit(c->destroy(c) ? 0 : 1);
> +	if (!c->destroy(c)) {
> +		fprintf(stderr, "Destroying %s failed\n", my_args.name);
> +		lxc_container_put(c);
> +		exit(1);
> +	}
> +
> +	lxc_container_put(c);
> +	return 0;
>  }
> -- 
> 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=60135031&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