mirror of
git://github.com/lxc/lxc
synced 2025-09-01 10:39:54 +00:00
Fix destroy() crash when no config is loaded
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com> Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
@@ -1957,7 +1957,7 @@ static bool lxcapi_destroy(struct lxc_container *c)
|
|||||||
goto out;
|
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);
|
r = bdev_init(c->lxc_conf->rootfs.path, c->lxc_conf->rootfs.mount, NULL);
|
||||||
if (r) {
|
if (r) {
|
||||||
if (r->ops->destroy(r) < 0) {
|
if (r->ops->destroy(r) < 0) {
|
||||||
|
Reference in New Issue
Block a user