summaryrefslogtreecommitdiff
path: root/src/or/main.c
diff options
context:
space:
mode:
authorteor <teor2345@gmail.com>2017-12-29 23:00:57 +1100
committerteor <teor2345@gmail.com>2017-12-30 17:19:42 +1100
commitd99ccf090f5c5cb4ca76524a73c6fd7543fe969e (patch)
treea31c4f12bc773e37892919838c2d1dc48f7bdfb1 /src/or/main.c
parentf5d89fab2525fd8a105f9f0ea9258147bf16290e (diff)
downloadtor-d99ccf090f5c5cb4ca76524a73c6fd7543fe969e.tar.gz
tor-d99ccf090f5c5cb4ca76524a73c6fd7543fe969e.zip
Stop trying to remove NULL filenames on shutdown
Fixes bug 24762; bugfix on master. (Not in any released version of Tor.)
Diffstat (limited to 'src/or/main.c')
-rw-r--r--src/or/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/main.c b/src/or/main.c
index e449b95b91..9e51e35bcb 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -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));
}