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

Dwight Engen dwight.engen at oracle.com
Wed Nov 6 15:32:02 UTC 2013


I accidentally introduced this with the change to lxc-info (commit
b9d957c3).

Signed-off-by: Dwight Engen <dwight.engen at oracle.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





More information about the lxc-devel mailing list