Fix possible segfault.

Set variable that is freed to NULL initially.