summaryrefslogtreecommitdiffstats
path: root/providers/common
diff options
context:
space:
mode:
authorPauli <paul.dale@oracle.com>2019-09-08 18:39:11 +1000
committerPauli <paul.dale@oracle.com>2019-09-11 08:27:27 +1000
commitf20a59cb1c21e360f000e541e2e41aceca515929 (patch)
treee9c6fcc2a33463b0fed75c26ac30be0a5aefa11f /providers/common
parentd111712f6a7ae0ce37062d75fa3fa72e277e7455 (diff)
Coverity 1453634: Resource leaks (RESOURCE_LEAK)
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/9805)
Diffstat (limited to 'providers/common')
-rw-r--r--providers/common/macs/kmac_prov.c4
1 files changed, 3 insertions, 1 deletions
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;