From: Stéphane Graber Date: Fri, 24 Jan 2014 02:41:28 +0000 (-0500) Subject: Fix destroy() crash when no config is loaded X-Git-Tag: lxc-1.0.0.beta3~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e8ff96bbf84fc381e74d8526a0860e1a45032f03;p=thirdparty%2Flxc.git Fix destroy() crash when no config is loaded Signed-off-by: Stéphane Graber Acked-by: Serge E. Hallyn --- diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index 1520cd3c7..fbf082424 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -1957,7 +1957,7 @@ static bool lxcapi_destroy(struct lxc_container *c) goto out; } - if (!am_unpriv() && c->lxc_conf->rootfs.path && c->lxc_conf->rootfs.mount) { + if (!am_unpriv() && c->lxc_conf && c->lxc_conf->rootfs.path && c->lxc_conf->rootfs.mount) { r = bdev_init(c->lxc_conf->rootfs.path, c->lxc_conf->rootfs.mount, NULL); if (r) { if (r->ops->destroy(r) < 0) {