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/proto.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'protocols/WhatsApp/src/proto.cpp') 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) { -- cgit v1.2.3