]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
scrypt: Do not free the context itself when fetch fails
authorTomas Mraz <tomas@openssl.org>
Mon, 20 Jan 2025 07:50:48 +0000 (08:50 +0100)
committerTomas Mraz <tomas@openssl.org>
Thu, 23 Jan 2025 11:08:14 +0000 (12:08 +0100)
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/26488)

(cherry picked from commit 2dded720223c6b84dcbeadbbcd1c6307fe815832)

providers/implementations/kdfs/scrypt.c

index e914eef9921d0ce45c1a84cfdcbfb38958416e61..e1161248bf09254609817cf86b5c9fcec2892b2e 100644 (file)
@@ -166,7 +166,6 @@ static int set_digest(KDF_SCRYPT *ctx)
     EVP_MD_free(ctx->sha256);
     ctx->sha256 = EVP_MD_fetch(ctx->libctx, "sha256", ctx->propq);
     if (ctx->sha256 == NULL) {
-        OPENSSL_free(ctx);
         ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_LOAD_SHA256);
         return 0;
     }