]> git.ipfire.org Git - thirdparty/openssl.git/commit
kmac_prov.c.in: avoid resource leak on kmac_new_decoder fail in kmac_fetch_new
authorEugene Syromiatnikov <esyr@openssl.org>
Wed, 10 Sep 2025 23:34:12 +0000 (01:34 +0200)
committerNeil Horman <nhorman@openssl.org>
Fri, 12 Sep 2025 17:35:32 +0000 (13:35 -0400)
commit3ae8755aa22a7b704d78453e3467f7355eb9c538
treee5475a6198be46cf65bc6675085c10a03b49c3b2
parent6c3046657e712240e8e931ca5bfe528684f95fb3
kmac_prov.c.in: avoid resource leak on kmac_new_decoder fail in kmac_fetch_new

kctx was not freed in a case of kmac_new_decoder failure;  consolidate
all the error paths under the "err:" label and jump to it on kmac_new_decoder()
returning 0.

Fixes: d5efc853796b "kmac: avoid using ossl_prov_digest_load_from_params()"
Resolves: https://github.com/openssl/project/issues/1419
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1453634
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28516)
providers/implementations/macs/kmac_prov.c.in