Fix memory leak.
This commit is contained in:
parent
0713f8abe6
commit
db75357110
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue