We actually zero out ctx, so normally those are already NULL.
I am not sure what happens in the case of protocol changes, such as passthrough mode. Because I am not sure if the code reaches there again (do we reinit logging?). And if it does reach there again, those are not NULL, and the fix you suggested would cause memory leak.