#Freeing memory from struct
1 messages · Page 1 of 1 (latest)
yeah
errdefer
Use errdefer for early resource cleanup upon returning an error, if that's what you mean.
Not sure what the question is beyond that
Panic is noreturn, so whatever defer you have will never run because the program will just exit. So freeing memory is not really important. But you can free just before the panic if you want to "not leak"