From b1a1e1483280b2f01a6a7f352a6aac7dcc621466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 25 Jan 2015 17:33:03 +0100 Subject: [PATCH] irc: free account before changing its value --- src/plugins/irc/irc-protocol.c | 9 +++++---- 1 file 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))