From 7b75796a6056e5ef65518c37008a1176417d2797 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Thu, 11 Jul 2019 13:23:14 +0200 Subject: cgroups: fix a leak when using cgroupfs be sure to load all the existing handlers, so that they can also be freed in addition to the handlers we treat differently. Signed-off-by: Giuseppe Scrivano --- pkg/cgroups/cgroups.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'pkg/cgroups') diff --git a/pkg/cgroups/cgroups.go b/pkg/cgroups/cgroups.go index de7f3fd0e..081db772f 100644 --- a/pkg/cgroups/cgroups.go +++ b/pkg/cgroups/cgroups.go @@ -327,6 +327,13 @@ func Load(path string) (*CgroupControl, error) { path: path, systemd: false, } + if !cgroup2 { + controllers, err := getAvailableControllers(handlers, false) + if err != nil { + return nil, err + } + control.additionalControllers = controllers + } if !cgroup2 { for name := range handlers { p := control.getCgroupv1Path(name) -- cgit v1.2.3-54-g00ecf