diff --git a/RSA.pm b/RSA.pm index 420e36a..f7131a4 100644 --- a/RSA.pm +++ b/RSA.pm @@ -377,10 +377,6 @@ Return true if this is a private key, and false if it is public only. =back -=head1 BUGS - -There is a small memory leak when generating new keys of more than 512 bits. - =head1 AUTHOR Ian Robertson, C. For support, please email diff --git a/RSA.xs b/RSA.xs index a3a6034..b2c03f9 100644 --- a/RSA.xs +++ b/RSA.xs @@ -511,6 +511,7 @@ generate_key(proto, bitsSV, exponent = 65537) BN_set_word(e, exponent); #if OPENSSL_VERSION_NUMBER < 0x00908000L rsa = RSA_generate_key(SvIV(bitsSV), exponent, NULL, NULL); + BN_free(e); CHECK_OPEN_SSL(rsa != NULL); #endif #if OPENSSL_VERSION_NUMBER >= 0x00908000L && OPENSSL_VERSION_NUMBER < 0x30000000L