aboutsummaryrefslogtreecommitdiffstats
path: root/ext/openssl/ossl_cipher.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/openssl/ossl_cipher.c')
-rw-r--r--ext/openssl/ossl_cipher.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/openssl/ossl_cipher.c b/ext/openssl/ossl_cipher.c
index e9808fb996..e4b9a022d2 100644
--- a/ext/openssl/ossl_cipher.c
+++ b/ext/openssl/ossl_cipher.c
@@ -143,7 +143,10 @@ ossl_cipher_copy(VALUE self, VALUE other)
GetCipherInit(self, ctx1);
if (!ctx1) {
- AllocCipher(self, ctx1);
+ ctx1 = EVP_CIPHER_CTX_new();
+ if (!ctx1)
+ ossl_raise(rb_eRuntimeError, "EVP_CIPHER_CTX_new() failed");
+ RTYPEDDATA_DATA(self) = ctx1;
}
SafeGetCipher(other, ctx2);
if (EVP_CIPHER_CTX_copy(ctx1, ctx2) != 1)