title: Freeing C variables in Golang?
body: <p>I'm confused about which variables need to be freed if I'm using C variables in Go.</p>
  
  <p>For example, if I do this:</p>
  
  <pre><code>    s := C.CString(`something`)
  </code></pre>
  
  <p>Is that memory now allocated until I call <code>C.free(unsafe.Pointer(s))</code>, or is that OK to be garbage collected by Go when the function ends?</p>
  
  <p>Or is it only variables that are created from the imported C code that need to be freed, and these C variables created from the Go code will be garbage collected?</p>