The go runtime will manage memory of thins allocated in Go land but you must manage memory in C land.
If you allocate memory using C.malloc you must use C.free otherwise you will leak memory.
If you allocate memory using C.malloc you must use C.free otherwise you will leak memory.