summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2015-01-25 15:00:38 +0100
committerSébastien Helleu <flashcode@flashtux.org>2015-01-25 15:00:38 +0100
commit0a75d79e93b773a98c42f3e104a8560fe4df1e3c (patch)
tree619cdc8ae9878f2f058e88c9429c13254d3d2f52 /src/plugins
parentd2ef6e675ddc0206099c8c018eefa993abe79d2a (diff)
downloadweechat-0a75d79e93b773a98c42f3e104a8560fe4df1e3c.zip
irc: fix memory leak on nick account in irc_channel_remove_account()
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/irc/irc-channel.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c
index 4445a3151..348e60a0b 100644
--- a/src/plugins/irc/irc-channel.c
+++ b/src/plugins/irc/irc-channel.c
@@ -690,8 +690,11 @@ irc_channel_remove_account (struct t_irc_server *server,
if (channel->type == IRC_CHANNEL_TYPE_CHANNEL)
{
- for (ptr_nick = channel->nicks; ptr_nick; ptr_nick = ptr_nick->next_nick)
+ for (ptr_nick = channel->nicks; ptr_nick;
+ ptr_nick = ptr_nick->next_nick)
{
+ if (ptr_nick->account)
+ free (ptr_nick->account);
ptr_nick->account = strdup ("*");
}
}
@@ -709,7 +712,8 @@ irc_channel_remove_away (struct t_irc_server *server,
if (channel->type == IRC_CHANNEL_TYPE_CHANNEL)
{
- for (ptr_nick = channel->nicks; ptr_nick; ptr_nick = ptr_nick->next_nick)
+ for (ptr_nick = channel->nicks; ptr_nick;
+ ptr_nick = ptr_nick->next_nick)
{
irc_nick_set_away (server, channel, ptr_nick, 0);
}