]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Revert "start: remove unnecessary check for valid cgroup_ops" 3352/head
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 3 Apr 2020 08:09:38 +0000 (10:09 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 3 Apr 2020 08:22:27 +0000 (10:22 +0200)
This reverts commit 52520e4f793f73e5956c2d9de9c83f074622ce1d.

This can be NULL when there's a pre-start hook which fails.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/lxc/start.c

index 9d800e30bb4cc6ccb4c96cd6669be4cccaf6ac2e..a25bd0409b3b8f7a3eaf178e3dd817fe7e490a9e 100644 (file)
@@ -933,8 +933,10 @@ void lxc_end(struct lxc_handler *handler)
 
        lsm_process_cleanup(handler->conf, handler->lxcpath);
 
-       cgroup_ops->payload_destroy(cgroup_ops, handler);
-       cgroup_ops->monitor_destroy(cgroup_ops, handler);
+       if (cgroup_ops) {
+               cgroup_ops->payload_destroy(cgroup_ops, handler);
+               cgroup_ops->monitor_destroy(cgroup_ops, handler);
+       }
 
        if (handler->conf->reboot == REBOOT_NONE) {
                /* For all new state clients simply close the command socket.