Add the file close operation before function return to release resource

Signed-off-by: Mabin <bin.ma@huawei.com>
This commit is contained in:
Mabin 2015-03-04 14:56:50 +08:00
parent 903680701a
commit c1fb904d10
1 changed files with 1 additions and 0 deletions

View File

@ -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) fd, _, syserr := syscall.RawSyscall(syscall.SYS_EVENTFD2, 0, syscall.FD_CLOEXEC, 0)
if syserr != 0 { if syserr != 0 {
oomControl.Close()
return nil, syserr return nil, syserr
} }