Skip to content

Commit d555eeb

Browse files
author
Mahmood Ali
authored
Merge pull request #173 from a-zagaevskiy/master
fix handles leakage Windows API docs states that process handlers should be released: > When you are finished with the handle, be sure to close it using the [CloseHandle](https://docs.microsoft.com/en-us/windows/win32/api/handleapi/nf-handleapi-closehandle) function. https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-openprocess
2 parents 3969aeb + 20881f4 commit d555eeb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

process_windows.go

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ func _pidAlive(pid int) bool {
1919
if err != nil {
2020
return false
2121
}
22+
defer syscall.CloseHandle(h)
2223

2324
var ec uint32
2425
if e := syscall.GetExitCodeProcess(h, &ec); e != nil {

0 commit comments

Comments
 (0)