]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Stop trying to remove NULL filenames on shutdown
authorteor <teor2345@gmail.com>
Fri, 29 Dec 2017 12:00:57 +0000 (23:00 +1100)
committerteor <teor2345@gmail.com>
Sat, 30 Dec 2017 06:19:42 +0000 (17:19 +1100)
Fixes bug 24762; bugfix on master.
(Not in any released version of Tor.)

changes/bug24762 [new file with mode: 0644]
src/or/main.c

diff --git a/changes/bug24762 b/changes/bug24762
new file mode 100644 (file)
index 0000000..e9d3bad
--- /dev/null
@@ -0,0 +1,3 @@
+  o Minor bugfixes (shutdown, file handling):
+    - Stop trying to remove NULL filenames on shutdown.
+      Fixes bug 24762; bugfix on master.
index e449b95b916725644d3df2c2827e893229fd9aba..9e51e35bcb82631ba0b2e7e858d620e34048a990 100644 (file)
@@ -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));
   }