From: Dwight Engen Date: Wed, 6 Nov 2013 15:32:02 +0000 (-0500) Subject: coverity 1126129: don't try to print c->name when c is NULL X-Git-Tag: lxc-1.0.0.alpha3~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9beb9ce0ef1c5975e922768afdf51dc39ca5b0b9;p=thirdparty%2Flxc.git coverity 1126129: don't try to print c->name when c is NULL I accidentally introduced this with the change to lxc-info (commit b9d957c3). Signed-off-by: Dwight Engen Signed-off-by: Serge Hallyn --- diff --git a/src/lxc/lxc_info.c b/src/lxc/lxc_info.c index ba43f3743..6c35bbbb5 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);