diff options
author | rhe <rhe@ruby-lang.org> | 2016-06-06 08:11:24 +0000 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2016-06-09 15:05:21 +0900 |
commit | 7432b065496ec48d0e6a92763f2d2306a19d973f (patch) | |
tree | 8ea4dc871eb3e6d3e9eb963ef0e17578476796a0 /ext | |
parent | c076bf718f48eab3140b6f9201617263b3ef2902 (diff) | |
download | ruby-openssl-7432b065496ec48d0e6a92763f2d2306a19d973f.tar.gz |
openssl: fix free function of OpenSSL::Cipher
* ext/openssl/ossl_cipher.c (ossl_cipher_free): Use EVP_CIPHER_CTX_free()
to free EVP_CIPHER_CTX allocated by EVP_CIPHER_CTX_new().
[ruby-core:75225] [Feature #12324]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/openssl/ossl_cipher.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/ext/openssl/ossl_cipher.c b/ext/openssl/ossl_cipher.c index 54e363fa..e1408b91 100644 --- a/ext/openssl/ossl_cipher.c +++ b/ext/openssl/ossl_cipher.c @@ -81,11 +81,7 @@ ossl_cipher_new(const EVP_CIPHER *cipher) static void ossl_cipher_free(void *ptr) { - EVP_CIPHER_CTX *ctx = ptr; - if (ctx) { - EVP_CIPHER_CTX_cleanup(ctx); - ruby_xfree(ctx); - } + EVP_CIPHER_CTX_free(ptr); } static VALUE |