mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Fix a small memory leak in webadmin
If the two passwords entered didn't match, webadmin leaked a CUser instance. This was found by cppcheck, too. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1762 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -1020,8 +1020,6 @@ CUser* CWebAdminSock::GetNewUser(CString& sPageRet, CUser* pUser) {
|
||||
sUsername = pUser->GetUserName();
|
||||
}
|
||||
|
||||
CUser* pNewUser = new CUser(sUsername);
|
||||
|
||||
CString sArg = GetParam("password");
|
||||
|
||||
if (sArg != GetParam("password2")) {
|
||||
@@ -1029,6 +1027,8 @@ CUser* CWebAdminSock::GetNewUser(CString& sPageRet, CUser* pUser) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CUser* pNewUser = new CUser(sUsername);
|
||||
|
||||
if (!sArg.empty()) {
|
||||
CString sSalt = CUtils::GetSalt();
|
||||
CString sHash = CUser::SaltedHash(sArg, sSalt);
|
||||
|
||||
Reference in New Issue
Block a user