Merge pull request #788 from LemonBoy/fix-787

Keep a copy of the strings coming from the config

(cherry picked from commit 933fac7e9d4d1cea93887cb38bab51c938a8c687)
This commit is contained in:
ailin-nemui 2017-11-14 08:50:06 +01:00
parent aea5802519
commit cacb48e4f4

View File

@ -109,6 +109,7 @@ static void hilight_destroy(HILIGHT_REC *rec)
if (rec->channels != NULL) g_strfreev(rec->channels); if (rec->channels != NULL) g_strfreev(rec->channels);
g_free_not_null(rec->color); g_free_not_null(rec->color);
g_free_not_null(rec->act_color); g_free_not_null(rec->act_color);
g_free_not_null(rec->servertag);
g_free(rec->text); g_free(rec->text);
g_free(rec); g_free(rec);
} }
@ -456,7 +457,7 @@ static void read_hilight_config(void)
CONFIG_NODE *node; CONFIG_NODE *node;
HILIGHT_REC *rec; HILIGHT_REC *rec;
GSList *tmp; GSList *tmp;
char *text, *color; char *text, *color, *servertag;
hilights_destroy_all(); hilights_destroy_all();
@ -499,7 +500,9 @@ static void read_hilight_config(void)
rec->nickmask = config_node_get_bool(node, "mask", FALSE); rec->nickmask = config_node_get_bool(node, "mask", FALSE);
rec->fullword = config_node_get_bool(node, "fullword", FALSE); rec->fullword = config_node_get_bool(node, "fullword", FALSE);
rec->regexp = config_node_get_bool(node, "regexp", FALSE); rec->regexp = config_node_get_bool(node, "regexp", FALSE);
rec->servertag = config_node_get_str(node, "servertag", NULL); servertag = config_node_get_str(node, "servertag", NULL);
rec->servertag = servertag == NULL || *servertag == '\0' ? NULL :
g_strdup(servertag);
hilight_init_rec(rec); hilight_init_rec(rec);
node = iconfig_node_section(node, "channels", -1); node = iconfig_node_section(node, "channels", -1);