summaryrefslogtreecommitdiff
path: root/protocols/WhatsApp/src/proto.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/proto.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/proto.cpp')
-rw-r--r--protocols/WhatsApp/src/proto.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/protocols/WhatsApp/src/proto.cpp b/protocols/WhatsApp/src/proto.cpp
index a1da570953..de7835cd86 100644
--- a/protocols/WhatsApp/src/proto.cpp
+++ b/protocols/WhatsApp/src/proto.cpp
@@ -212,15 +212,16 @@ string WhatsAppProto::Register(int state, string cc, string number, string code)
BYTE idxBuf[16];
utils::md5string(tm.str(), idxBuf);
idx = std::string((const char*) idxBuf, 16);
- db_set_s(0, m_szModuleName,WHATSAPP_KEY_IDX, idx.c_str());
+ db_set_s(0, m_szModuleName, WHATSAPP_KEY_IDX, idx.c_str());
}
string url;
if (state == REG_STATE_REQ_CODE)
{
- string token(Utilities::md5String(std::string(ACCOUNT_TOKEN_PREFIX1) + ACCOUNT_TOKEN_PREFIX2 + number));
+ unsigned char digest[16];
+ utils::md5string(std::string(ACCOUNT_TOKEN_PREFIX1) + ACCOUNT_TOKEN_PREFIX2 + number, digest);
url = string(ACCOUNT_URL_CODEREQUESTV2);
- url += "?lc=US&lg=en&mcc=000&mnc=000&method=sms&token="+ token;
+ url += "?lc=US&lg=en&mcc=000&mnc=000&method=sms&token=" + Utilities::bytesToHex(digest, 16);
}
else if (state == REG_STATE_REG_CODE)
{