summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-11-20 12:16:47 +0000
committerRoger Dingledine <arma@torproject.org>2004-11-20 12:16:47 +0000
commit246b14d8e9bf422eaea95176fccc60c658ba76f8 (patch)
tree479eff8f3a451e899dd36bdcc1dc12cc0b177827
parent6322287dc16a4714a18aed1b39cfb381454f479d (diff)
downloadtor-246b14d8e9bf422eaea95176fccc60c658ba76f8.tar.gz
tor-246b14d8e9bf422eaea95176fccc60c658ba76f8.zip
yes, in fact, i broke it. putting back.
svn:r2918
-rw-r--r--src/common/log.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/common/log.c b/src/common/log.c
index 8c4ff3adc5..80b4ada61e 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -345,16 +345,16 @@ int add_callback_log(int loglevelMin, int loglevelMax, log_callback cb)
/** Close any log handlers added by add_temp_log or marked by mark_logs_temp */
void close_temp_logs(void)
{
- logfile_t *victim, *lf;
- for (lf = logfiles; lf; ) {
- if (lf->is_temporary) {
- victim = lf;
- lf = lf->next;
- close_log(victim);
- tor_free(victim->filename);
- tor_free(victim);
+ logfile_t *lf, **p;
+ for (p = &logfiles; *p; ) {
+ if ((*p)->is_temporary) {
+ lf = *p;
+ *p = (*p)->next;
+ close_log(lf);
+ tor_free(lf->filename);
+ tor_free(lf);
} else {
- lf = lf->next;
+ p = &((*p)->next);
}
}
}