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:
parent
010c4fbdc5
commit
00533129dc
2 changed files with 27 additions and 0 deletions
|
@ -242,6 +242,12 @@ static struct InfoStruct info_table[] = {
|
||||||
&ConfigFileEntry.fname_serverlog,
|
&ConfigFileEntry.fname_serverlog,
|
||||||
"Server connect/disconnect log file"
|
"Server connect/disconnect log file"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"fname_killlog",
|
||||||
|
OUTPUT_STRING,
|
||||||
|
&ConfigFileEntry.fname_killlog,
|
||||||
|
"KILL log file"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fname_klinelog",
|
"fname_klinelog",
|
||||||
OUTPUT_STRING,
|
OUTPUT_STRING,
|
||||||
|
|
21
src/s_conf.c
21
src/s_conf.c
|
@ -732,6 +732,7 @@ set_default_conf(void)
|
||||||
ConfigFileEntry.fname_operlog = NULL;
|
ConfigFileEntry.fname_operlog = NULL;
|
||||||
ConfigFileEntry.fname_foperlog = NULL;
|
ConfigFileEntry.fname_foperlog = NULL;
|
||||||
ConfigFileEntry.fname_serverlog = NULL;
|
ConfigFileEntry.fname_serverlog = NULL;
|
||||||
|
ConfigFileEntry.fname_killlog = NULL;
|
||||||
ConfigFileEntry.fname_klinelog = NULL;
|
ConfigFileEntry.fname_klinelog = NULL;
|
||||||
ConfigFileEntry.fname_operspylog = NULL;
|
ConfigFileEntry.fname_operspylog = NULL;
|
||||||
ConfigFileEntry.fname_ioerrorlog = NULL;
|
ConfigFileEntry.fname_ioerrorlog = NULL;
|
||||||
|
@ -1487,6 +1488,26 @@ clear_out_old_conf(void)
|
||||||
rb_free(ConfigFileEntry.kline_reason);
|
rb_free(ConfigFileEntry.kline_reason);
|
||||||
ConfigFileEntry.kline_reason = NULL;
|
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_DLINK_FOREACH_SAFE(ptr, next_ptr, service_list.head)
|
||||||
{
|
{
|
||||||
rb_free(ptr->data);
|
rb_free(ptr->data);
|
||||||
|
|
Loading…
Reference in a new issue