summaryrefslogtreecommitdiffstats
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:11:20 +0200
commit2fd9c433712a08474af071cef538ffcd94dc4b57 (patch)
tree71a5329eeaa9e10b0cb463edc467f7a2632aa481 /engines
parent1be120ac5bf613a7277250b6e73f3c60adad4517 (diff)
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) (cherry picked from commit 6f6a5e0c7c41b6b3639e51f435cd98bb3ae061bc)
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 4b17228461..ccf838a9ea 100644
--- a/engines/e_afalg.c
+++ b/engines/e_afalg.c
@@ -624,11 +624,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);