[lxc-devel] [PATCH] coverity 1126129: don't try to print c->name when c is NULL

Serge Hallyn serge.hallyn at ubuntu.com
Wed Nov 6 15:36:04 UTC 2013


Quoting Dwight Engen (dwight.engen at oracle.com):
> I accidentally introduced this with the change to lxc-info (commit
> b9d957c3).
> 
> Signed-off-by: Dwight Engen <dwight.engen at oracle.com>

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

> ---
>  src/lxc/lxc_info.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/src/lxc/lxc_info.c b/src/lxc/lxc_info.c
> index ba43f37..6c35bbb 100644
> --- a/src/lxc/lxc_info.c
> +++ b/src/lxc/lxc_info.c
> @@ -255,10 +255,8 @@ static int print_info(const char *name, const char *lxcpath)
>  	struct lxc_container *c;
>  
>  	c = lxc_container_new(name, lxcpath);
> -	if (!c) {
> -		fprintf(stderr, "Insufficent privileges to control %s\n", c->name);
> +	if (!c)
>  		return -1;
> -	}
>  
>  	if (!c->may_control(c)) {
>  		fprintf(stderr, "Insufficent privileges to control %s\n", c->name);
> -- 
> 1.8.3.1
> 
> 
> ------------------------------------------------------------------------------
> November Webinars for C, C++, Fortran Developers
> Accelerate application performance with scalable programming models. Explore
> techniques for threading, error checking, porting, and tuning. Get the most 
> from the latest Intel processors and coprocessors. See abstracts and register
> http://pubads.g.doubleclick.net/gampad/clk?id=60136231&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