Add the file close operation before function return to release resource
Signed-off-by: Mabin <bin.ma@huawei.com>
This commit is contained in:
parent
903680701a
commit
c1fb904d10
|
@ -26,6 +26,7 @@ func notifyOnOOM(paths map[string]string) (<-chan struct{}, error) {
|
|||
}
|
||||
fd, _, syserr := syscall.RawSyscall(syscall.SYS_EVENTFD2, 0, syscall.FD_CLOEXEC, 0)
|
||||
if syserr != 0 {
|
||||
oomControl.Close()
|
||||
return nil, syserr
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue