diff options
author | Pauli <pauli@openssl.org> | 2023-03-17 12:11:16 +1100 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2023-03-21 09:00:36 +1100 |
commit | 7c45b7cbb04e297c3342fcc50bf7b0a9e36df1dd (patch) | |
tree | dc077b9e51c737d6b536111266062a4e72b020e3 /providers | |
parent | c9c99018a887bfac1fe5a5ae6dcd8a5647494504 (diff) | |
download | openssl-7c45b7cbb04e297c3342fcc50bf7b0a9e36df1dd.tar.gz |
Coverity 1522032: use after free
Fix use after free error.
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/20528)
Diffstat (limited to 'providers')
-rw-r--r-- | providers/implementations/kdfs/argon2.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/providers/implementations/kdfs/argon2.c b/providers/implementations/kdfs/argon2.c index 89947472c0..cb9e69a7a3 100644 --- a/providers/implementations/kdfs/argon2.c +++ b/providers/implementations/kdfs/argon2.c @@ -1033,10 +1033,11 @@ static int kdf_argon2_derive(void *vctx, unsigned char *out, size_t outlen, ctx->md = EVP_MD_fetch(ctx->libctx, "blake2b512", ctx->propq); if (ctx->md == NULL) { + EVP_MAC_free(ctx->mac); OPENSSL_free(ctx); ERR_raise_data(ERR_LIB_PROV, PROV_R_MISSING_MESSAGE_DIGEST, "canot fetch blake2b512"); - goto fail1; + return 0; } if (ctx->salt == NULL || ctx->saltlen == 0) { @@ -1135,7 +1136,6 @@ fail3: fail2: EVP_MD_free(ctx->md); -fail1: EVP_MAC_free(ctx->mac); return 0; |