From d25b15263abf713527c7fbf1f1a3f8e036a376d0 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Sun, 14 May 2017 18:06:27 +0200 Subject: [PATCH] cmd/syncthing: Process handle should be closed --- cmd/syncthing/cpuusage_windows.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/syncthing/cpuusage_windows.go b/cmd/syncthing/cpuusage_windows.go index 9aac2bf1..597c6f83 100644 --- a/cmd/syncthing/cpuusage_windows.go +++ b/cmd/syncthing/cpuusage_windows.go @@ -16,6 +16,7 @@ func cpuUsage() time.Duration { if err != nil { return 0 } + defer syscall.CloseHandle(handle) var ctime, etime, ktime, utime syscall.Filetime if err := syscall.GetProcessTimes(handle, &ctime, &etime, &ktime, &utime); err != nil {