Remove some superfluous safeguards

free(NULL) is perfectly fine.