I have function that maybe returns a string ?[] const u8.
When the result is null there is no memory allocated and nothing needs to be freed.
defer runs at the end of a block, so if I think the memory will get freed too early if I put the defer inside a conditional like this:
if (maybe_string) |a_string| {
defer gpa.free(a_string);
}
What is the correct pattern here?