fix a leak when adding a temp log

svn:r14203
This commit is contained in:
Roger Dingledine 2008-03-26 18:59:45 +00:00
parent 8dfccf6145
commit e9221f4a0d

View File

@ -539,6 +539,7 @@ add_temp_log(void)
set_log_severity_config(LOG_NOTICE, LOG_ERR, s);
LOCK_LOGS();
add_stream_log_impl(s, "<temp>", stdout);
tor_free(s);
logfiles->is_temporary = 1;
UNLOCK_LOGS();
}
@ -583,7 +584,8 @@ change_callback_log_severity(int loglevelMin, int loglevelMax,
UNLOCK_LOGS();
}
/** Close any log handlers added by add_temp_log or marked by mark_logs_temp */
/** Close any log handlers added by add_temp_log() or marked by
* mark_logs_temp(). */
void
close_temp_logs(void)
{
@ -619,7 +621,7 @@ rollback_log_changes(void)
close_temp_logs();
}
/** Configure all log handles to be closed by close_temp_logs */
/** Configure all log handles to be closed by close_temp_logs(). */
void
mark_logs_temp(void)
{