summaryrefslogtreecommitdiff
path: root/src/common/log.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2003-10-18 00:07:58 +0000
committerRoger Dingledine <arma@torproject.org>2003-10-18 00:07:58 +0000
commit82aa621b47018838c9659d34ab34cd6517815daa (patch)
tree765fd68a8b8a57499ff2e5980d8e3c27e72eda14 /src/common/log.c
parent96f47a3eca9723a491f3b551a7b39147cc8c5949 (diff)
downloadtor-82aa621b47018838c9659d34ab34cd6517815daa.tar.gz
tor-82aa621b47018838c9659d34ab34cd6517815daa.zip
rewrite close_logs so it could possibly work
remove deadbeef memory-clobber testing (for now) svn:r616
Diffstat (limited to 'src/common/log.c')
-rw-r--r--src/common/log.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/common/log.c b/src/common/log.c
index faa8f64891..3a60d0576d 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -116,14 +116,14 @@ void _log_fn(int severity, const char *fn, const char *format, ...)
void close_logs()
{
- logfile_t *next, *lf;
- for (lf = logfiles; lf; lf = lf->next) {
- if (lf->needs_close)
- fclose(lf->file);
- next = lf->next;
- free(lf);
+ logfile_t *victim;
+ while(logfiles) {
+ victim = logfiles;
+ logfiles = logfiles->next;
+ if (victim->needs_close)
+ fclose(victim->file);
+ free(victim);
}
- logfiles = NULL;
}
void reset_logs()