Don't leak vfs.MountNamespace reference if kernel.TaskSet.NewTask fails.

PiperOrigin-RevId: 308617610
This commit is contained in:
Jamie Liu 2020-04-27 07:37:45 -07:00 committed by gVisor bot
parent 3c67754663
commit 292f3f99b7
1 changed files with 3 additions and 0 deletions

View File

@ -104,6 +104,9 @@ func (ts *TaskSet) NewTask(cfg *TaskConfig) (*Task, error) {
cfg.TaskContext.release()
cfg.FSContext.DecRef()
cfg.FDTable.DecRef()
if cfg.MountNamespaceVFS2 != nil {
cfg.MountNamespaceVFS2.DecRef()
}
return nil, err
}
return t, nil