summaryrefslogtreecommitdiff
path: root/pkg/cgroups
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2019-07-11 13:23:14 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2019-07-11 18:07:49 +0200
commit7b75796a6056e5ef65518c37008a1176417d2797 (patch)
tree81e52496fc0a9666ae7cdedde5a5e8aea206cab9 /pkg/cgroups
parent1601100b3e9935f4239529c9117c76b8dd5d762a (diff)
downloadpodman-7b75796a6056e5ef65518c37008a1176417d2797.tar.gz
podman-7b75796a6056e5ef65518c37008a1176417d2797.tar.bz2
podman-7b75796a6056e5ef65518c37008a1176417d2797.zip
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 <gscrivan@redhat.com>
Diffstat (limited to 'pkg/cgroups')
-rw-r--r--pkg/cgroups/cgroups.go7
1 files changed, 7 insertions, 0 deletions
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
@@ -328,6 +328,13 @@ func Load(path string) (*CgroupControl, error) {
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)
if _, err := os.Stat(p); err != nil {