summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-01-02 09:54:56 -0500
committerNick Mathewson <nickm@torproject.org>2018-01-02 09:54:56 -0500
commit2819e9467e229c2469b6fb0fd584f5cf020ffd3e (patch)
tree443e7d053fd3efe64155a170bcbb67d196ecc372
parent5051cfe9bd66aa68c6825c00e107f759c921a9ff (diff)
parentd99ccf090f5c5cb4ca76524a73c6fd7543fe969e (diff)
downloadtor-2819e9467e229c2469b6fb0fd584f5cf020ffd3e.tar.gz
tor-2819e9467e229c2469b6fb0fd584f5cf020ffd3e.zip
Merge remote-tracking branch 'teor/bug24762'
-rw-r--r--changes/bug247623
-rw-r--r--src/or/main.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/changes/bug24762 b/changes/bug24762
new file mode 100644
index 0000000000..e9d3badaa8
--- /dev/null
+++ b/changes/bug24762
@@ -0,0 +1,3 @@
+ o Minor bugfixes (shutdown, file handling):
+ - Stop trying to remove NULL filenames on shutdown.
+ Fixes bug 24762; bugfix on master.
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));
}