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 <psychon@znc.in>
This commit is contained in:
Uli Schlachter
2011-07-27 15:14:01 +02:00
parent f1cb09bd9c
commit 9685f16b96
+2 -1
View File
@@ -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);
}