[or-cvs] Fix bug in close_logs(): when we close and delete logs, rem...

Nick Mathewson nickm at seul.org
Mon Mar 13 00:54:24 UTC 2006


Update of /home/or/cvsroot/tor/src/common
In directory moria:/tmp/cvs-serv7620/src/common

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

Index: log.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/log.c,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -p -d -r1.115 -r1.116
--- log.c	18 Feb 2006 07:18:14 -0000	1.115
+++ log.c	13 Mar 2006 00:54:21 -0000	1.116
@@ -314,10 +314,12 @@ _log_err(uint32_t domain, const char *fo
 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);



More information about the tor-commits mailing list