mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 04:52:59 +01:00
Fix memory leak in multiUserAuthorized
This commit is contained in:
parent
5a0b7e4106
commit
99f001eb52
@ -113,8 +113,8 @@ static bool multiUserAuthorized(std::string strUserPass)
|
|||||||
std::string strHash = vFields[2];
|
std::string strHash = vFields[2];
|
||||||
|
|
||||||
unsigned int KEY_SIZE = 32;
|
unsigned int KEY_SIZE = 32;
|
||||||
unsigned char *out = new unsigned char[KEY_SIZE];
|
unsigned char out[KEY_SIZE];
|
||||||
|
|
||||||
CHMAC_SHA256(reinterpret_cast<const unsigned char*>(strSalt.c_str()), strSalt.size()).Write(reinterpret_cast<const unsigned char*>(strPass.c_str()), strPass.size()).Finalize(out);
|
CHMAC_SHA256(reinterpret_cast<const unsigned char*>(strSalt.c_str()), strSalt.size()).Write(reinterpret_cast<const unsigned char*>(strPass.c_str()), strPass.size()).Finalize(out);
|
||||||
std::vector<unsigned char> hexvec(out, out+KEY_SIZE);
|
std::vector<unsigned char> hexvec(out, out+KEY_SIZE);
|
||||||
std::string strHashFromPass = HexStr(hexvec);
|
std::string strHashFromPass = HexStr(hexvec);
|
||||||
|
Loading…
Reference in New Issue
Block a user