This check isn't strictly necessary, `free` can be called on `NULL`.