extism / go-pdk

Extism Plug-in Development Kit (PDK) for Go
https://pkg.go.dev/github.com/extism/go-pdk
BSD 3-Clause "New" or "Revised" License
60 stars 11 forks source link

fix: free up memory after we're done with it #12

Closed mhmd-azeez closed 1 year ago

mhmd-azeez commented 1 year ago

This PR makes sure we are free-ing up memory after we're done with it in Log, GetVar, SetVar, and SetVar

mhmd-azeez commented 1 year ago

@zshipko Maybe we should remove this free here? I think the SDK should free the response body:

https://github.com/extism/go-pdk/blob/65bffbeb3e64c9b68fb5b3503b199021e045800f/extism_pdk.go#L262

zshipko commented 1 year ago

@zshipko Maybe we should remove this free here? I think the SDK should free the response body:

https://github.com/extism/go-pdk/blob/65bffbeb3e64c9b68fb5b3503b199021e045800f/extism_pdk.go#L262

Yeah, good catch!