No need to check for NULL here, `free(NULL)` does nothing.