From: S.Çağlar Onur Date: Sat, 19 Oct 2013 04:48:08 +0000 (-0400) Subject: call lxc_container_put when needed in lxc_destroy.c X-Git-Tag: lxc-1.0.0.alpha3~89 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=93ea85c71b50282d8761b376f6a1da9029d0759b;p=thirdparty%2Flxc.git call lxc_container_put when needed in lxc_destroy.c Signed-off-by: S.Çağlar Onur Signed-off-by: Serge Hallyn --- diff --git a/src/lxc/lxc_destroy.c b/src/lxc/lxc_destroy.c index 9983241d9..1d1e6878b 100644 --- a/src/lxc/lxc_destroy.c +++ b/src/lxc/lxc_destroy.c @@ -108,5 +108,12 @@ int main(int argc, char *argv[]) c->stop(c); } - exit(c->destroy(c) ? 0 : 1); + if (!c->destroy(c)) { + fprintf(stderr, "Destroying %s failed\n", my_args.name); + lxc_container_put(c); + exit(1); + } + + lxc_container_put(c); + return 0; }