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
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);