libwg-go: more efficient and safer string passing
It was unclear when the Go string was actually freed. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
@@ -161,8 +161,8 @@ func wgGetSocketV6(tunnelHandle int32) int32 {
|
||||
}
|
||||
|
||||
//export wgVersion
|
||||
func wgVersion() string {
|
||||
return WireGuardGoVersion
|
||||
func wgVersion() *C.char {
|
||||
return C.CString(WireGuardGoVersion)
|
||||
}
|
||||
|
||||
func main() {}
|
||||
|
||||
Reference in New Issue
Block a user