Merge pull request #205 from hugoduncan/fix-leaking-fd-in-netns
Fix leaking file descriptor in NetNs strategy
This commit is contained in:
commit
30e50af760
|
@ -30,8 +30,10 @@ func (v *NetNS) Initialize(config *Network, networkState *NetworkState) error {
|
|||
}
|
||||
|
||||
if err := system.Setns(f.Fd(), syscall.CLONE_NEWNET); err != nil {
|
||||
f.Close()
|
||||
return fmt.Errorf("failed to setns current network namespace: %v", err)
|
||||
}
|
||||
|
||||
f.Close()
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue