summaryrefslogtreecommitdiff
path: root/protocols/WhatsApp/src/WhatsAPI++/WALogin.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-06-24 15:40:31 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-06-24 15:40:31 +0000
commitb40015c18a9acd7272d850df4389de98009a91f4 (patch)
tree9582786cb85e1a69ca48931965acc07c11486a09 /protocols/WhatsApp/src/WhatsAPI++/WALogin.cpp
parent2f28d4cb509676a01cca5c18823309293faefef3 (diff)
memory leak fix inside bytesToHex
git-svn-id: http://svn.miranda-ng.org/main/trunk@5122 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/WhatsApp/src/WhatsAPI++/WALogin.cpp')
-rw-r--r--protocols/WhatsApp/src/WhatsAPI++/WALogin.cpp6
1 files changed, 3 insertions, 3 deletions
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<unsigned char>* 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());