From 1ab65d264fee46914571415551ed78cde14315a6 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 28 Mar 2015 13:35:02 +0000 Subject: - unused code removed; - dynamic memory allocation for JabberSha1() replaced with static git-svn-id: http://svn.miranda-ng.org/main/trunk@12535 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/JabberG/src/jabber_iqid.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'protocols/JabberG/src/jabber_iqid.cpp') diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index cc0f8d4bd4..d502c21daf 100644 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -216,14 +216,11 @@ void CJabberProto::OnIqResultGetAuth(HXML iqNode, CJabberIqInfo*) HXML query = iq << XQUERY(_T("jabber:iq:auth")); query << XCHILD(_T("username"), m_ThreadInfo->conn.username); if (xmlGetChild(queryNode, "digest") != NULL && m_ThreadInfo->szStreamId) { - char* str = mir_utf8encodeT(m_ThreadInfo->conn.password); + JabberShaStrBuf buf; + ptrA str(mir_utf8encodeT(m_ThreadInfo->conn.password)); char text[200]; mir_snprintf(text, SIZEOF(text), "%s%s", m_ThreadInfo->szStreamId, str); - mir_free(str); - if ((str = JabberSha1(text)) != NULL) { - query << XCHILD(_T("digest"), _A2T(str)); - mir_free(str); - } + query << XCHILD(_T("digest"), _A2T(JabberSha1(text, buf))); } else if (xmlGetChild(queryNode, "password") != NULL) query << XCHILD(_T("password"), m_ThreadInfo->conn.password); -- cgit v1.2.3