From 5c5f052bc27067800a7bf37d918459d0e892078b Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Mon, 2 Oct 2017 10:28:47 -0700 Subject: [PATCH] explicit free, and remove header that isn't available on mac/linux --- libraries/entities/src/EntityItem.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; }