|
@@ -3480,12 +3480,12 @@ tor_free_all(int postfork)
|
|
|
|
|
|
/**
|
|
|
* Remove the specified file, and log a warning if the operation fails for
|
|
|
- * any reason other than the file not existing.
|
|
|
+ * any reason other than the file not existing. Ignores NULL filenames.
|
|
|
*/
|
|
|
void
|
|
|
tor_remove_file(const char *filename)
|
|
|
{
|
|
|
- if (tor_unlink(filename) != 0 && errno != ENOENT) {
|
|
|
+ if (filename && tor_unlink(filename) != 0 && errno != ENOENT) {
|
|
|
log_warn(LD_FS, "Couldn't unlink %s: %s",
|
|
|
filename, strerror(errno));
|
|
|
}
|