1
0
mirror of https://github.com/moparisthebest/hexchat synced 2024-12-01 13:42:16 -05:00

Avoid useless strdup() and free() calls

This commit is contained in:
Berke Viktor 2013-05-19 12:17:37 +02:00
parent 67274f91e9
commit 5fa23341b3

View File

@ -1194,15 +1194,17 @@ servlist_load_defaults (void)
if (def[i].network) if (def[i].network)
{ {
net = servlist_net_add (def[i].network, def[i].host, FALSE); net = servlist_net_add (def[i].network, def[i].host, FALSE);
net->encoding = strdup (IRC_DEFAULT_CHARSET);
if (def[i].channel) if (def[i].channel)
{ {
servlist_favchan_add (net, def[i].channel); servlist_favchan_add (net, def[i].channel);
} }
if (def[i].charset) if (def[i].charset)
{ {
free (net->encoding); net->encoding = g_strdup (def[i].charset);
net->encoding = strdup (def[i].charset); }
else
{
net->encoding = g_strdup (IRC_DEFAULT_CHARSET);
} }
if (def[i].loginmode) if (def[i].loginmode)
{ {