summaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2021-10-04 19:45:19 +0200
committerBernd Edlinger <bernd.edlinger@hotmail.de>2021-10-06 15:09:51 +0200
commit6f6a5e0c7c41b6b3639e51f435cd98bb3ae061bc (patch)
tree69550a28ce942202a276b71c58956cd3f9cd2a51 /engines
parent59cd0bc1364b5ea817af7f6d36df89c93610cdb5 (diff)
downloadopenssl-new-6f6a5e0c7c41b6b3639e51f435cd98bb3ae061bc.tar.gz
Fix a memory leak in the afalg engine
Fixes: #16743 Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16744)
Diffstat (limited to 'engines')
-rw-r--r--engines/e_afalg.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/engines/e_afalg.c b/engines/e_afalg.c
index d8d3ef610c..2c08cbb28d 100644
--- a/engines/e_afalg.c
+++ b/engines/e_afalg.c
@@ -683,11 +683,8 @@ static int afalg_cipher_cleanup(EVP_CIPHER_CTX *ctx)
}
actx = (afalg_ctx *) EVP_CIPHER_CTX_get_cipher_data(ctx);
- if (actx == NULL || actx->init_done != MAGIC_INIT_NUM) {
- ALG_WARN("%s afalg ctx passed\n",
- ctx == NULL ? "NULL" : "Uninitialised");
- return 0;
- }
+ if (actx == NULL || actx->init_done != MAGIC_INIT_NUM)
+ return 1;
close(actx->sfd);
close(actx->bfd);