Fixed file descriptor leak on linux
This commit is contained in:
parent
c5d7efc246
commit
bd6027a4d5
2 changed files with 6 additions and 4 deletions
|
|
@ -37,6 +37,8 @@ func (tun *NativeTun) setMTU(n int) error {
|
|||
return err
|
||||
}
|
||||
|
||||
defer syscall.Close(fd)
|
||||
|
||||
// do ioctl call
|
||||
|
||||
var ifr [64]byte
|
||||
|
|
@ -70,6 +72,8 @@ func (tun *NativeTun) MTU() (int, error) {
|
|||
return 0, err
|
||||
}
|
||||
|
||||
defer syscall.Close(fd)
|
||||
|
||||
// do ioctl call
|
||||
|
||||
var ifr [64]byte
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue