From: Tomas Mraz Date: Mon, 20 Jan 2025 07:50:48 +0000 (+0100) Subject: scrypt: Do not free the context itself when fetch fails X-Git-Tag: openssl-3.1.8~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=231d2297a69a591eaed63c1444bf6873948edb40;p=thirdparty%2Fopenssl.git 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) --- diff --git a/providers/implementations/kdfs/scrypt.c b/providers/implementations/kdfs/scrypt.c index e914eef9921..e1161248bf0 100644 --- a/providers/implementations/kdfs/scrypt.c +++ b/providers/implementations/kdfs/scrypt.c @@ -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; }