diff options
author | Ben Laurie <ben@openssl.org> | 2001-08-05 16:13:49 +0000 |
---|---|---|
committer | Ben Laurie <ben@openssl.org> | 2001-08-05 16:13:49 +0000 |
commit | db7535711049fcfdc71145029b0efc775fa17a5a (patch) | |
tree | dc7c3a9fe912c82c9e6b490d45435475360e0149 | |
parent | 0713f8abe6e1b3cebc9d48c0c70d0edd252da5d4 (diff) | |
download | openssl-db7535711049fcfdc71145029b0efc775fa17a5a.tar.gz |
Fix memory leak.
-rw-r--r-- | crypto/evp/evp_enc.c | 4 |
1 files 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; |