mirror of
git://github.com/lxc/lxc
synced 2025-08-31 02:17:58 +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;
|
||||
}
|
||||
|
||||
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) {
|
||||
|
Reference in New Issue
Block a user