Browse Source

Fix bug in close_logs(): when we close and delete logs, remove them all from the global "logfiles" list. This should fix bug 222.

svn:r6145
Nick Mathewson 18 years ago
parent
commit
daea6b21a5
1 changed files with 6 additions and 4 deletions
  1. 6 4
      src/common/log.c

+ 6 - 4
src/common/log.c

@@ -314,10 +314,12 @@ _log_err(uint32_t domain, const char *format, ...)
 void
 close_logs(void)
 {
-  logfile_t *victim;
-  while (logfiles) {
-    victim = logfiles;
-    logfiles = logfiles->next;
+  logfile_t *victim, *next;
+  next = logfiles;
+  logfiles = NULL;
+  while (next) {
+    victim = next;
+    next = next->next;
     close_log(victim);
     tor_free(victim->filename);
     tor_free(victim);