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:
Jason A. Donenfeld
2018-06-05 02:18:12 +02:00
parent 40a30d997d
commit dea60e13c0
2 changed files with 7 additions and 10 deletions
@@ -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() {}