summaryrefslogtreecommitdiffstats
path: root/providers/implementations/keymgmt
diff options
context:
space:
mode:
authorPauli <pauli@openssl.org>2021-11-04 15:05:59 +1000
committerPauli <pauli@openssl.org>2021-11-08 08:55:32 +1000
commit1b4d9967a24154f1dc00f471eb843203ec7bb7d4 (patch)
treec221cd0a67794c4cef3bc54262051447a221248f /providers/implementations/keymgmt
parentfe4125382301201e42a3251544cda429bba0c9d7 (diff)
Address Coverity 1493362 resource leak
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16962)
Diffstat (limited to 'providers/implementations/keymgmt')
-rw-r--r--providers/implementations/keymgmt/mac_legacy_kmgmt.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/providers/implementations/keymgmt/mac_legacy_kmgmt.c b/providers/implementations/keymgmt/mac_legacy_kmgmt.c
index 63553996bd..ec34a3ee71 100644
--- a/providers/implementations/keymgmt/mac_legacy_kmgmt.c
+++ b/providers/implementations/keymgmt/mac_legacy_kmgmt.c
@@ -508,6 +508,7 @@ static void *mac_gen(void *genctx, OSSL_CALLBACK *cb, void *cbarg)
* of this can be removed and we will only support the EVP_KDF APIs.
*/
if (!ossl_prov_cipher_copy(&key->cipher, &gctx->cipher)) {
+ ossl_mac_key_free(key);
ERR_raise(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR);
return NULL;
}