aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2017-01-10 15:05:35 -0800
committerPieter Wuille <pieter.wuille@gmail.com>2017-01-12 11:52:53 -0800
commit99f001eb52dda703bd326833430054b108de35a1 (patch)
tree152779abf1f35d8b005e8a61d3a98ea27d5a2946 /src
parent5a0b7e4106bc97a7a67bda6bf6fbd7f26d892420 (diff)
Fix memory leak in multiUserAuthorized
Diffstat (limited to 'src')
-rw-r--r--src/httprpc.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/httprpc.cpp b/src/httprpc.cpp
index 742ff2b8fb..93beda09a4 100644
--- a/src/httprpc.cpp
+++ b/src/httprpc.cpp
@@ -113,8 +113,8 @@ static bool multiUserAuthorized(std::string strUserPass)
std::string strHash = vFields[2];
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);
std::vector<unsigned char> hexvec(out, out+KEY_SIZE);
std::string strHashFromPass = HexStr(hexvec);