certstore
certstore copied to clipboard
use LocalLock and LocalFree
Ian Lance Taylor wrote in https://github.com/golang/go/issues/51726#issuecomment-1069824759:
It looks like the code that led to this issue is calling FormatMessage with the FORMAT_MESSAGE_ALLOCATE_BUFFER which does indeed allocate memory using LocalAlloc. It's then casually converting that memory to char*, which I guess is fine today but it should really be calling LocalLock, and should really be passing the original value to LocalFree.
We should probably do that.
cc @dblohm7