From b40015c18a9acd7272d850df4389de98009a91f4 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 24 Jun 2013 15:40:31 +0000 Subject: memory leak fix inside bytesToHex git-svn-id: http://svn.miranda-ng.org/main/trunk@5122 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/WhatsApp/src/WhatsAPI++/WALogin.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'protocols/WhatsApp/src/WhatsAPI++/WALogin.cpp') diff --git a/protocols/WhatsApp/src/WhatsAPI++/WALogin.cpp b/protocols/WhatsApp/src/WhatsAPI++/WALogin.cpp index 37d5fe0378..af21776b83 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/WALogin.cpp +++ b/protocols/WhatsApp/src/WhatsAPI++/WALogin.cpp @@ -91,12 +91,12 @@ std::string WALogin::getResponse(const std::string& challenge) { std::string digest_uri = "xmpp/" + this->domain; std::vector* A1 = bos.toByteArray(); std::string A2 = "AUTHENTICATE:" + digest_uri; - std::string KD((char*) bytesToHex(utils::md5string(&A1->front(), (int)A1->size(), md5_buffer), SIZEOF(md5_buffer)), SIZEOF(md5_buffer) * 2); - KD += + ":" + nonce + ":" + nc + ":" + cnonce + ":auth:" + std::string((char*) bytesToHex(utils::md5string(A2, md5_buffer), SIZEOF(md5_buffer)), SIZEOF(md5_buffer)*2); + std::string KD = bytesToHex(utils::md5string(&A1->front(), (int)A1->size(), md5_buffer), SIZEOF(md5_buffer)); + KD += + ":" + nonce + ":" + nc + ":" + cnonce + ":auth:" + bytesToHex(utils::md5string(A2, md5_buffer), SIZEOF(md5_buffer)); _LOGDATA("KD = %s", KD.c_str()); - std::string response((char*) bytesToHex(utils::md5string(KD, md5_buffer), SIZEOF(md5_buffer)), SIZEOF(md5_buffer)*2); + std::string response = bytesToHex(utils::md5string(KD, md5_buffer), SIZEOF(md5_buffer)); _LOGDATA("response = %s", response.c_str()); -- cgit v1.2.3