Skip to content

Commit c1fb904

Browse files
committed
Add the file close operation before function return to release resource
Signed-off-by: Mabin <[email protected]>
1 parent 9036807 commit c1fb904

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

notify_linux.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ func notifyOnOOM(paths map[string]string) (<-chan struct{}, error) {
2626
}
2727
fd, _, syserr := syscall.RawSyscall(syscall.SYS_EVENTFD2, 0, syscall.FD_CLOEXEC, 0)
2828
if syserr != 0 {
29+
oomControl.Close()
2930
return nil, syserr
3031
}
3132

0 commit comments

Comments
 (0)