Skip to content

Commit 3d26fc3

Browse files
author
Denys Smirnov
committed
cgroups/fs: fix NPE on Destroy than no cgroups are set
Currently Manager accepts nil cgroups when calling Apply, but it will panic then trying to call Destroy with the same config. Signed-off-by: Denys Smirnov <[email protected]>
1 parent ce80fa0 commit 3d26fc3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libcontainer/cgroups/fs/apply_raw.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ func (m *Manager) Apply(pid int) (err error) {
161161
}
162162

163163
func (m *Manager) Destroy() error {
164-
if m.Cgroups.Paths != nil {
164+
if m.Cgroups == nil || m.Cgroups.Paths != nil {
165165
return nil
166166
}
167167
m.mu.Lock()

0 commit comments

Comments
 (0)