From f20a59cb1c21e360f000e541e2e41aceca515929 Mon Sep 17 00:00:00 2001 From: Pauli Date: Sun, 8 Sep 2019 18:39:11 +1000 Subject: [PATCH] Coverity 1453634: Resource leaks (RESOURCE_LEAK) Reviewed-by: Bernd Edlinger (Merged from https://github.com/openssl/openssl/pull/9805) --- providers/common/macs/kmac_prov.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/providers/common/macs/kmac_prov.c b/providers/common/macs/kmac_prov.c index 53598418db..99bcbf7da9 100644 --- a/providers/common/macs/kmac_prov.c +++ b/providers/common/macs/kmac_prov.c @@ -174,8 +174,10 @@ static void *kmac_fetch_new(void *provctx, const OSSL_PARAM *params) if (kctx == NULL) return 0; if (!ossl_prov_digest_load_from_params(&kctx->digest, params, - PROV_LIBRARY_CONTEXT_OF(provctx))) + PROV_LIBRARY_CONTEXT_OF(provctx))) { + kmac_free(kctx); return 0; + } kctx->out_len = EVP_MD_size(ossl_prov_digest_md(&kctx->digest)); return kctx; -- 2.25.1