s_conf: Don't leak log file paths when loading default conf

This change prevents the log file paths from being leaked when
rehashing. Additionally, fname_killlog was added to two places where it
was previously forgotten.
This commit is contained in:
Keith Buck 2014-03-03 04:12:07 +00:00
parent 010c4fbdc5
commit 00533129dc
2 changed files with 27 additions and 0 deletions

View file

@ -242,6 +242,12 @@ static struct InfoStruct info_table[] = {
&ConfigFileEntry.fname_serverlog,
"Server connect/disconnect log file"
},
{
"fname_killlog",
OUTPUT_STRING,
&ConfigFileEntry.fname_killlog,
"KILL log file"
},
{
"fname_klinelog",
OUTPUT_STRING,

View file

@ -732,6 +732,7 @@ set_default_conf(void)
ConfigFileEntry.fname_operlog = NULL;
ConfigFileEntry.fname_foperlog = NULL;
ConfigFileEntry.fname_serverlog = NULL;
ConfigFileEntry.fname_killlog = NULL;
ConfigFileEntry.fname_klinelog = NULL;
ConfigFileEntry.fname_operspylog = NULL;
ConfigFileEntry.fname_ioerrorlog = NULL;
@ -1487,6 +1488,26 @@ clear_out_old_conf(void)
rb_free(ConfigFileEntry.kline_reason);
ConfigFileEntry.kline_reason = NULL;
/* clean out log */
rb_free(ConfigFileEntry.fname_userlog);
ConfigFileEntry.fname_userlog = NULL;
rb_free(ConfigFileEntry.fname_fuserlog);
ConfigFileEntry.fname_fuserlog = NULL;
rb_free(ConfigFileEntry.fname_operlog);
ConfigFileEntry.fname_operlog = NULL;
rb_free(ConfigFileEntry.fname_foperlog);
ConfigFileEntry.fname_foperlog = NULL;
rb_free(ConfigFileEntry.fname_serverlog);
ConfigFileEntry.fname_serverlog = NULL;
rb_free(ConfigFileEntry.fname_killlog);
ConfigFileEntry.fname_killlog = NULL;
rb_free(ConfigFileEntry.fname_klinelog);
ConfigFileEntry.fname_klinelog = NULL;
rb_free(ConfigFileEntry.fname_operspylog);
ConfigFileEntry.fname_operspylog = NULL;
rb_free(ConfigFileEntry.fname_ioerrorlog);
ConfigFileEntry.fname_ioerrorlog = NULL;
RB_DLINK_FOREACH_SAFE(ptr, next_ptr, service_list.head)
{
rb_free(ptr->data);