Browse Source

Stop trying to remove NULL filenames on shutdown

Fixes bug 24762; bugfix on master.
(Not in any released version of Tor.)
teor 6 years ago
parent
commit
d99ccf090f
2 changed files with 5 additions and 2 deletions
  1. 3 0
      changes/bug24762
  2. 2 2
      src/or/main.c

+ 3 - 0
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.

+ 2 - 2
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));
   }