summaryrefslogtreecommitdiff
path: root/src/common/log.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-03-13 00:54:21 +0000
committerNick Mathewson <nickm@torproject.org>2006-03-13 00:54:21 +0000
commitdaea6b21a536ff1d60310c35bd89844614ec9d7f (patch)
tree25cc65f05d31423a57fee2bb7d23dec961129901 /src/common/log.c
parent0c132ee2a1be2a4f6ce081bc883d88dcd810e8b8 (diff)
downloadtor-daea6b21a536ff1d60310c35bd89844614ec9d7f.tar.gz
tor-daea6b21a536ff1d60310c35bd89844614ec9d7f.zip
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
Diffstat (limited to 'src/common/log.c')
-rw-r--r--src/common/log.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/common/log.c b/src/common/log.c
index 68a3c068e0..2cdd8e86cd 100644
--- a/src/common/log.c
+++ b/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);