]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
coverity 1126129: don't try to print c->name when c is NULL
authorDwight Engen <dwight.engen@oracle.com>
Wed, 6 Nov 2013 15:32:02 +0000 (10:32 -0500)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 6 Nov 2013 15:37:21 +0000 (09:37 -0600)
I accidentally introduced this with the change to lxc-info (commit
b9d957c3).

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxc_info.c

index ba43f37430cd54f0323e4c819b811fb14bfcb639..6c35bbbb5e596a04a0a3b38bf98a2fe70b6ad73d 100644 (file)
@@ -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);