From: Pauli Date: Sun, 8 Sep 2019 08:39:11 +0000 (+1000) Subject: Coverity 1453634: Resource leaks (RESOURCE_LEAK) X-Git-Tag: openssl-3.0.0-alpha1~1403 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f20a59cb1c21e360f000e541e2e41aceca515929;p=thirdparty%2Fopenssl.git Coverity 1453634: Resource leaks (RESOURCE_LEAK) Reviewed-by: Bernd Edlinger (Merged from https://github.com/openssl/openssl/pull/9805) --- diff --git a/providers/common/macs/kmac_prov.c b/providers/common/macs/kmac_prov.c index 53598418dba..99bcbf7da99 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;