From 5fa23341b38280e7451a512dc95df58851fcb471 Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Sun, 19 May 2013 12:17:37 +0200 Subject: Avoid useless strdup() and free() calls --- src/common/servlist.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/common') 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) { -- cgit 1.4.1