summary refs log tree commit diff stats
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/servlist.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/common/servlist.c b/src/common/servlist.c
index 52985a60..d121dd47 100644
--- a/src/common/servlist.c
+++ b/src/common/servlist.c
@@ -1194,15 +1194,17 @@ servlist_load_defaults (void)
 		if (def[i].network)
 		{
 			net = servlist_net_add (def[i].network, def[i].host, FALSE);
-			net->encoding = strdup (IRC_DEFAULT_CHARSET);
 			if (def[i].channel)
 			{
 				servlist_favchan_add (net, def[i].channel);
 			}
 			if (def[i].charset)
 			{
-				free (net->encoding);
-				net->encoding = strdup (def[i].charset);
+				net->encoding = g_strdup (def[i].charset);
+			}
+			else
+			{
+				net->encoding = g_strdup (IRC_DEFAULT_CHARSET);
 			}
 			if (def[i].loginmode)
 			{