diff options
author | Donald Stufft <donald@stufft.io> | 2014-04-09 09:58:26 -0400 |
---|---|---|
committer | Donald Stufft <donald@stufft.io> | 2014-04-09 09:58:26 -0400 |
commit | cb7285b87c384b94609ccd7699d7be9ee97b93de (patch) | |
tree | b332316342fcccfd90201af729fe1076c2d1c69b | |
parent | b64162c9091fb91b50c19e48ddfb23d81074d4f4 (diff) | |
parent | 4653af01f785d6d086ed6b3ca248e1083781135c (diff) | |
download | cryptography-cb7285b87c384b94609ccd7699d7be9ee97b93de.tar.gz cryptography-cb7285b87c384b94609ccd7699d7be9ee97b93de.tar.bz2 cryptography-cb7285b87c384b94609ccd7699d7be9ee97b93de.zip |
Merge pull request #906 from reaperhulk/free-some-stuff
Free some pkey ctxes we were leaking
-rw-r--r-- | cryptography/hazmat/backends/openssl/backend.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cryptography/hazmat/backends/openssl/backend.py b/cryptography/hazmat/backends/openssl/backend.py index 900d25c2..47d4e37d 100644 --- a/cryptography/hazmat/backends/openssl/backend.py +++ b/cryptography/hazmat/backends/openssl/backend.py @@ -843,6 +843,8 @@ class _RSASignatureContext(object): evp_pkey, self._backend._ffi.NULL ) assert pkey_ctx != self._backend._ffi.NULL + pkey_ctx = self._backend._ffi.gc(pkey_ctx, + self._backend._lib.EVP_PKEY_CTX_free) res = self._backend._lib.EVP_PKEY_sign_init(pkey_ctx) assert res == 1 res = self._backend._lib.EVP_PKEY_CTX_set_signature_md( @@ -1028,6 +1030,8 @@ class _RSAVerificationContext(object): evp_pkey, self._backend._ffi.NULL ) assert pkey_ctx != self._backend._ffi.NULL + pkey_ctx = self._backend._ffi.gc(pkey_ctx, + self._backend._lib.EVP_PKEY_CTX_free) res = self._backend._lib.EVP_PKEY_verify_init(pkey_ctx) assert res == 1 res = self._backend._lib.EVP_PKEY_CTX_set_signature_md( |