exploit the fact that free(NULL) is valid (and does nothing) to benefit from clearer cleanups