Преглед изворни кода

cmd/syncthing: Process handle should be closed

Jakob Borg пре 8 година
родитељ
комит
d25b15263a
1 измењених фајлова са 1 додато и 0 уклоњено
  1. 1 0
      cmd/syncthing/cpuusage_windows.go

+ 1 - 0
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 {