Skip to content

Commit

Permalink
convert to C.HLOCAL via unsafe.Pointer
Browse files Browse the repository at this point in the history
See golang/go#51726 for discussion.
  • Loading branch information
josharian committed Mar 16, 2022
1 parent 42db9b9 commit 07181a0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion certstore_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,8 @@ func (c errCode) Error() string {
if cmsg == nil {
return fmt.Sprintf("Error %X", int(c))
}
defer C.LocalFree(C.HLOCAL(cmsg))
// See https://github.com/golang/go/issues/51726#issuecomment-1069615452.
defer C.LocalFree(C.HLOCAL(unsafe.Pointer(cmsg)))

gomsg := C.GoString(cmsg)

Expand Down

0 comments on commit 07181a0

Please sign in to comment.