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 <denys@sourced.tech>
This commit is contained in:
parent
ce80fa0a64
commit
3d26fc3fd7
|
@ -161,7 +161,7 @@ func (m *Manager) Apply(pid int) (err error) {
|
|||
}
|
||||
|
||||
func (m *Manager) Destroy() error {
|
||||
if m.Cgroups.Paths != nil {
|
||||
if m.Cgroups == nil || m.Cgroups.Paths != nil {
|
||||
return nil
|
||||
}
|
||||
m.mu.Lock()
|
||||
|
|
Loading…
Reference in New Issue