mirror of
https://github.com/opencontainers/runc.git
synced 2026-04-22 23:17:17 +08:00
libct: close child fds on prepareCgroupFD error
The (*setns).start is supposed to close child fds once the child has started, or upon an error. Commit5af4dd4e6added a bug -- child fds are not closed if prepareCgroupFD fails. Fix by adding a missing call to closeChild. I'm not sure how to write a good test case for it. Found when working on PR 4928 (and tested in there). Fixes:5af4dd4e6Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -357,6 +357,7 @@ func (p *setnsProcess) start() (retErr error) {
|
||||
|
||||
fd, err := p.prepareCgroupFD()
|
||||
if err != nil {
|
||||
p.comm.closeChild()
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user