]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Fix destroy() crash when no config is loaded
authorStéphane Graber <stgraber@ubuntu.com>
Fri, 24 Jan 2014 02:41:28 +0000 (21:41 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 24 Jan 2014 16:33:31 +0000 (11:33 -0500)
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxccontainer.c

index 1520cd3c76550642264babee5bb808ea1cbd2811..fbf0824249b8c21df248e79d79276f4d1a84f7bb 100644 (file)
@@ -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) {