commit 2819e9467e229c2469b6fb0fd584f5cf020ffd3e
parent 5051cfe9bd66aa68c6825c00e107f759c921a9ff
Author: Nick Mathewson <nickm@torproject.org>
Date: Tue, 2 Jan 2018 09:54:56 -0500
Merge remote-tracking branch 'teor/bug24762'
Diffstat:
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/changes/bug24762 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
@@ -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));
}