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
This commit is contained in:
Nick Mathewson 2006-03-13 00:54:21 +00:00
parent 0c132ee2a1
commit daea6b21a5

View File

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