diff --git a/libraries/entities/src/EntityItem.cpp b/libraries/entities/src/EntityItem.cpp index dbdfbdb0e6..ebe7c53bd4 100644 --- a/libraries/entities/src/EntityItem.cpp +++ b/libraries/entities/src/EntityItem.cpp @@ -14,8 +14,7 @@ #include #include #include -#include // see comments for DEBUG_CERT -#include +#include // see comments for DEBUG_CERT #include #include @@ -1637,6 +1636,7 @@ KxHof+LmYSYZAiB4U+yEh9SsXdq40W/3fpLMPuNq1PRezJ5jGidGMcvF+wIgUNec\n\ unsigned int signatureLength = 0; const int signOK = RSA_sign(NID_sha256, text, textLength, reinterpret_cast(signature.data()), &signatureLength, rsa); BIO_free(bio); + RSA_free(rsa); if (!signOK) { qCWarning(entities) << "Unable to compute signature for" << getName() << getEntityItemID(); return ""; @@ -1670,6 +1670,8 @@ AqbcNnrV/TcG6LPI7ZbiMjdUixmTNvYMRZH3Wlqtl2IKG1W68y3stKECAwEAAQ==\n\ RSA* rsa = EVP_PKEY_get1_RSA(evp_key); bool answer = RSA_verify(NID_sha256, text, textLength, signature, signatureLength, rsa); BIO_free(bio); + RSA_free(rsa); + EVP_PKEY_free(evp_key); return answer; }