[packages] znc: Fix a memory leak in CChan::AddNick()
authorjogo <jogo@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 27 Jul 2011 14:27:32 +0000 (14:27 +0000)
committerjogo <jogo@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 27 Jul 2011 14:27:32 +0000 (14:27 +0000)
Backport upstream fix reported by Olipro. Thanks!

git-svn-id: svn://svn.openwrt.org/openwrt/packages@27798 3c298f89-4303-0410-b956-a3cf2f4a3e73

net/znc/Makefile
net/znc/patches/004-fix_memleak.patch [new file with mode: 0644]

index 1de6243..25530e8 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=znc
 PKG_VERSION:=0.098
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://znc.in/releases
diff --git a/net/znc/patches/004-fix_memleak.patch b/net/znc/patches/004-fix_memleak.patch
new file mode 100644 (file)
index 0000000..51394c0
--- /dev/null
@@ -0,0 +1,14 @@
+--- a/Chan.cpp
++++ b/Chan.cpp
+@@ -417,9 +417,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);
+       }