From db7535711049fcfdc71145029b0efc775fa17a5a Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Sun, 5 Aug 2001 16:13:49 +0000 Subject: [PATCH] Fix memory leak. --- crypto/evp/evp_enc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c index d67f0cda43..e3ed556f26 100644 --- a/crypto/evp/evp_enc.c +++ b/crypto/evp/evp_enc.c @@ -78,8 +78,8 @@ int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, if(enc && (enc != -1)) enc = 1; if (cipher) { - if(ctx->cipher_data) - OPENSSL_free(ctx->cipher_data); + if(ctx->cipher) + EVP_CIPHER_CTX_cleanup(ctx); ctx->cipher=cipher; ctx->cipher_data=OPENSSL_malloc(ctx->cipher->ctx_size); ctx->key_len = cipher->key_len; -- 2.25.1