From 1fb2dd4460e202449dd3468fd5a408b6737bddae Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 16 Oct 2014 15:13:45 -0700 Subject: [PATCH] use OPENSSL_free to free DER private and public key buffers --- libraries/networking/src/RSAKeypairGenerator.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/networking/src/RSAKeypairGenerator.cpp b/libraries/networking/src/RSAKeypairGenerator.cpp index 0112f33ded..a51a17c0ca 100644 --- a/libraries/networking/src/RSAKeypairGenerator.cpp +++ b/libraries/networking/src/RSAKeypairGenerator.cpp @@ -66,11 +66,11 @@ void RSAKeypairGenerator::generateKeypair() { // cleanup the public and private key DER data, if required if (publicKeyLength > 0) { - delete[] publicKeyDER; + OPENSSL_free(publicKeyDER); } if (privateKeyLength > 0) { - delete[] privateKeyDER; + OPENSSL_free(privateKeyDER); } return; @@ -84,8 +84,8 @@ void RSAKeypairGenerator::generateKeypair() { QByteArray privateKeyArray(reinterpret_cast(privateKeyDER), privateKeyLength); // cleanup the publicKeyDER and publicKeyDER data - delete[] publicKeyDER; - delete[] privateKeyDER; + OPENSSL_free(publicKeyDER); + OPENSSL_free(privateKeyDER); emit generatedKeypair(publicKeyArray, privateKeyArray); } \ No newline at end of file