Remove unnecessary NULL check before free()

Passing NULL to free is a no-op.