diff options
| author | Overmind JIANG <[email protected]> | 2015-11-18 11:36:34 +0800 |
|---|---|---|
| committer | Overmind JIANG <[email protected]> | 2015-11-18 11:36:34 +0800 |
| commit | 3c6c4a7b3df9082188ec45f3e636440abfc5c563 (patch) | |
| tree | fcc183e68b243b708e18275053db579d92dd6cc2 /openssl/src | |
| parent | Remove unecessary build dependency (diff) | |
| download | rust-openssl-3c6c4a7b3df9082188ec45f3e636440abfc5c563.tar.xz rust-openssl-3c6c4a7b3df9082188ec45f3e636440abfc5c563.zip | |
Fix a leak when using `EVP_PKEY_get1_RSA`.
`EVP_PKEY_get1_RSA` returns a RSA structure with its reference count
increased by 1 and therefore we need to call `RSA_free` after finishing
using that value.
Diffstat (limited to 'openssl/src')
| -rw-r--r-- | openssl/src/crypto/pkey.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/openssl/src/crypto/pkey.rs b/openssl/src/crypto/pkey.rs index 6ca0aa12..741c6749 100644 --- a/openssl/src/crypto/pkey.rs +++ b/openssl/src/crypto/pkey.rs @@ -120,6 +120,7 @@ impl PKey { let mut s = repeat(0u8).take(len as usize).collect::<Vec<_>>(); let r = f(rsa, &s.as_mut_ptr()); + ffi::RSA_free(rsa); s.truncate(r as usize); s |