Guarding against freeing NULL pointers.