mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 04:44:11 +02:00
use OPENSSL_free to free DER private and public key buffers
This commit is contained in:
parent
f9e9a743fb
commit
1fb2dd4460
1 changed files with 4 additions and 4 deletions
|
@ -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<char*>(privateKeyDER), privateKeyLength);
|
||||
|
||||
// cleanup the publicKeyDER and publicKeyDER data
|
||||
delete[] publicKeyDER;
|
||||
delete[] privateKeyDER;
|
||||
OPENSSL_free(publicKeyDER);
|
||||
OPENSSL_free(privateKeyDER);
|
||||
|
||||
emit generatedKeypair(publicKeyArray, privateKeyArray);
|
||||
}
|
Loading…
Reference in a new issue