diff --git a/src/s_conf.c b/src/s_conf.c index 203e59f5..e858dce8 100644 --- a/src/s_conf.c +++ b/src/s_conf.c @@ -673,8 +673,8 @@ set_default_conf(void) /* ServerInfo.name is not rehashable */ /* ServerInfo.name = ServerInfo.name; */ ServerInfo.description = NULL; - ServerInfo.network_name = rb_strdup(NETWORK_NAME_DEFAULT); - ServerInfo.network_desc = rb_strdup(NETWORK_DESC_DEFAULT); + ServerInfo.network_name = NULL; + ServerInfo.network_desc = NULL; memset(&ServerInfo.ip, 0, sizeof(ServerInfo.ip)); ServerInfo.specific_ipv4_vhost = 0; @@ -689,9 +689,9 @@ set_default_conf(void) AdminInfo.email = NULL; AdminInfo.description = NULL; - ConfigFileEntry.default_operstring = rb_strdup("is an IRC operator"); - ConfigFileEntry.default_adminstring = rb_strdup("is a Server Administrator"); - ConfigFileEntry.servicestring = rb_strdup("is a Network Service"); + ConfigFileEntry.default_operstring = NULL; + ConfigFileEntry.default_adminstring = NULL; + ConfigFileEntry.servicestring = NULL; ConfigFileEntry.default_umodes = UMODE_INVISIBLE; ConfigFileEntry.failed_oper_notice = YES; @@ -875,6 +875,16 @@ validate_conf(void) } + /* General conf */ + if (ConfigFileEntry.default_operstring == NULL) + ConfigFileEntry.default_operstring = rb_strdup("is an IRC operator"); + + if (ConfigFileEntry.default_adminstring == NULL) + ConfigFileEntry.default_adminstring = rb_strdup("is a Server Administrator"); + + if (ConfigFileEntry.servicestring == NULL) + ConfigFileEntry.servicestring = rb_strdup("is a Network Service"); + /* RFC 1459 says 1 message per 2 seconds on average and bursts of * 5 messages are acceptable, so allow at least that. */ @@ -1468,6 +1478,12 @@ clear_out_old_conf(void) */ /* clean out general */ + rb_free(ConfigFileEntry.default_operstring); + ConfigFileEntry.default_operstring = NULL; + rb_free(ConfigFileEntry.default_adminstring); + ConfigFileEntry.default_adminstring = NULL; + rb_free(ConfigFileEntry.servicestring); + ConfigFileEntry.servicestring = NULL; rb_free(ConfigFileEntry.kline_reason); ConfigFileEntry.kline_reason = NULL;