From d7aec4702ab8d821babbd8f6614bf97d55e676a8 Mon Sep 17 00:00:00 2001 From: ManiacTwister Date: Mon, 26 Nov 2018 22:03:42 +0100 Subject: [PATCH] Initialize fakechan topic to NULL, allocate an empty string if not overridden --- src/newconf.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/newconf.c b/src/newconf.c index 22a98887..f20428fa 100644 --- a/src/newconf.c +++ b/src/newconf.c @@ -1812,7 +1812,7 @@ conf_begin_fakechannel(struct TopConf *tc) yy_fakechannel->name = rb_strdup(conf_cur_block_name); /* Set defaults */ - yy_fakechannel->topic = ""; + yy_fakechannel->topic = NULL yy_fakechannel->users_min = 50; yy_fakechannel->users_max = 300; @@ -1845,6 +1845,11 @@ conf_end_fakechannel(struct TopConf *tc) return -1; } + if(yy_fakechannel->topic == NULL) + { + yy_fakechannel->topic = rb_strdup(""); + } + irc_dictionary_add(fakechannel_dict, yy_fakechannel->name, yy_fakechannel); return 0;