From 9685f16b96729119aae91df0007990881fe1e1c3 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Wed, 27 Jul 2011 15:14:01 +0200 Subject: [PATCH] Fix a memleak in CChan::AddNick() This memleak existed since 5e070e788 from almost a year ago. Thanks to Olipro for reporting this. Signed-off-by: Uli Schlachter --- Chan.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Chan.cpp b/Chan.cpp index e7195aaa..cdfd694a 100644 --- a/Chan.cpp +++ b/Chan.cpp @@ -435,9 +435,10 @@ bool CChan::AddNick(const CString& sNick) { // Get the nick sTmp = sTmp.Token(0, false, "!"); + CNick tmpNick(sTmp); CNick* pNick = FindNick(sTmp); if (!pNick) { - pNick = new CNick(sTmp); + pNick = &tmpNick; pNick->SetUser(m_pUser); }