SKALE-2977 fix memory leak

parent 06add52d
......@@ -156,6 +156,11 @@ bool verifyECDSASig(string& pubKeyStr, const char *hashHex, const char *signatur
return false;
}
mpz_clear(msgMpz);
signature_free(sig);
domain_parameters_clear(curve);
point_clear(publicKey);
return true;
}
......
......@@ -79,7 +79,7 @@ bool checkHex(const string& hex, const uint32_t sizeInBytes){
mpz_t num;
mpz_init(num);
if ( mpz_set_str(num, hex.c_str(), 16) == -1){
if (mpz_set_str(num, hex.c_str(), 16) == -1) {
spdlog::error("key is not hex {}", hex);
mpz_clear(num);
return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment