From 01e6b7148046c3f41849d093bc61454279792b80 Mon Sep 17 00:00:00 2001 From: Serge Hallyn Date: Wed, 14 Aug 2013 14:58:48 -0500 Subject: [PATCH] lxc_destroy: print an error if the container is not defined. Signed-off-by: Serge Hallyn --- src/lxc/lxc_destroy.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lxc/lxc_destroy.c b/src/lxc/lxc_destroy.c index 9a1b11fba..0724eb808 100644 --- a/src/lxc/lxc_destroy.c +++ b/src/lxc/lxc_destroy.c @@ -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); -- 2.47.2