microsoft / go-winio

Win32 IO-related utilities for Go
MIT License
953 stars 181 forks source link

Memory leak due to miss to free up channel/timer in Win32File #304

Open jshen14 opened 11 months ago

jshen14 commented 11 months ago

Hi,

Thanks for creating go-winio repo. It is a great help.

I want to report an issue found. In my test, I find there is some memory leakage related to Win32File in file.go. In Win32File.Close, it misses to free up channel/timer which are dynamically allocated.

specifically, I mean channel/timer object in below struct

https://github.com/microsoft/go-winio/blob/main/file.go#L86-L96