diff options
author | Berke Viktor <bviktor@hexchat.org> | 2013-05-19 12:17:37 +0200 |
---|---|---|
committer | Berke Viktor <bviktor@hexchat.org> | 2013-05-19 12:17:37 +0200 |
commit | 5fa23341b38280e7451a512dc95df58851fcb471 (patch) | |
tree | d7467164b5c8c4558006a18c25baee66bd00a59e /src/common | |
parent | 67274f91e92e38f5c4e42bbc4a61e40ff85f9f67 (diff) |
Avoid useless strdup() and free() calls
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/servlist.c | 8 |
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) { |