diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2015-01-25 17:33:03 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2015-01-25 17:34:22 +0100 |
commit | b1a1e1483280b2f01a6a7f352a6aac7dcc621466 (patch) | |
tree | 2eac5d241db4ed9be78fd5ca569e0bec9382f3e6 /src/plugins/irc | |
parent | 5559b43518033d36e7d91cb998aa9d712e957649 (diff) | |
download | weechat-b1a1e1483280b2f01a6a7f352a6aac7dcc621466.zip |
irc: free account before changing its value
Diffstat (limited to 'src/plugins/irc')
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 2ef0b051e..fad0fa3a0 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -4303,10 +4303,11 @@ IRC_PROTOCOL_CALLBACK(354) } /* update account flag for nick */ - if (ptr_channel && ptr_nick && pos_account && server->cap_account_notify) - ptr_nick->account = (pos_account) ? strdup (pos_account) : strdup ("*"); - else - ptr_nick->account = strdup ("*"); + if (ptr_nick->account) + free (ptr_nick->account); + ptr_nick->account = (ptr_channel && ptr_nick && pos_account + && server->cap_account_notify) ? + strdup (pos_account) : strdup ("*"); /* display output of who (manual who from user) */ if (!ptr_channel || (ptr_channel->checking_whox <= 0)) |