]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc_destroy: print an error if the container is not defined.
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 14 Aug 2013 19:58:48 +0000 (14:58 -0500)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 14 Aug 2013 20:00:01 +0000 (15:00 -0500)
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxc_destroy.c

index 9a1b11fbab3b07c258ebf808eff8e271d317d9b0..0724eb80821355075f9c2e15f26897b9d501cb66 100644 (file)
@@ -84,9 +84,16 @@ int main(int argc, char *argv[])
                exit(1);
        }
 
+       if (!c->is_defined(c)) {
+               fprintf(stderr, "Container is not defined\n");
+               lxc_container_put(c);
+               exit(1);
+       }
+
        if (c->is_running(c)) {
                if (!my_args.force) {
                        fprintf(stderr, "%s is running\n", my_args.name);
+                       lxc_container_put(c);
                        exit(1);
                }
                c->stop(c);