From aa60bb3a5a440131cfd1526e01c6e983bbb46d14 Mon Sep 17 00:00:00 2001 From: Tomas Mraz Date: Mon, 20 Jan 2025 08:50:48 +0100 Subject: [PATCH] scrypt: Do not free the context itself when fetch fails Reviewed-by: Paul Dale Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/26488) (cherry picked from commit 2dded720223c6b84dcbeadbbcd1c6307fe815832) --- providers/implementations/kdfs/scrypt.c | 1 - 1 file changed, 1 deletion(-) diff --git a/providers/implementations/kdfs/scrypt.c b/providers/implementations/kdfs/scrypt.c index ee2d4a7d321..a6f8ca03ee4 100644 --- a/providers/implementations/kdfs/scrypt.c +++ b/providers/implementations/kdfs/scrypt.c @@ -162,7 +162,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; } -- 2.47.2