Skip to content

Commit 99f001e

Browse files
committed
Fix memory leak in multiUserAuthorized
1 parent 5a0b7e4 commit 99f001e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/httprpc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ static bool multiUserAuthorized(std::string strUserPass)
113113
std::string strHash = vFields[2];
114114

115115
unsigned int KEY_SIZE = 32;
116-
unsigned char *out = new unsigned char[KEY_SIZE];
117-
116+
unsigned char out[KEY_SIZE];
117+
118118
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);
119119
std::vector<unsigned char> hexvec(out, out+KEY_SIZE);
120120
std::string strHashFromPass = HexStr(hexvec);

0 commit comments

Comments
 (0)