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))