From 174d7a1a5633a3fa436b2232a06dad7b893ed533 Mon Sep 17 00:00:00 2001 From: lcc Date: Mon, 26 May 2025 17:29:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BC=82=E5=B8=B8=E5=88=86?= =?UTF-8?q?=E6=94=AF=E5=86=85=E5=AD=98=E6=B3=84=E6=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lcc --- plugin/openssl_plugin/crypto_operation/hmac/src/mac_openssl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin/openssl_plugin/crypto_operation/hmac/src/mac_openssl.c b/plugin/openssl_plugin/crypto_operation/hmac/src/mac_openssl.c index 9767baa..b2c67b5 100644 --- a/plugin/openssl_plugin/crypto_operation/hmac/src/mac_openssl.c +++ b/plugin/openssl_plugin/crypto_operation/hmac/src/mac_openssl.c @@ -335,13 +335,15 @@ HcfResult OpensslCmacSpiCreate(HcfMacParamsSpec *paramsSpec, HcfMacSpi **spiObj) } EVP_MAC *mac = EVP_MAC_fetch(NULL, "CMAC", NULL); if (mac == NULL) { - LOGD("fetch failed"); + LOGE("fetch failed"); + HcfFree(returnSpiImpl); return HCF_ERR_CRYPTO_OPERATION; } returnSpiImpl->ctx = EVP_MAC_CTX_new(mac); if (returnSpiImpl->ctx == NULL) { LOGD("[error] Failed to create ctx!"); HcfFree(returnSpiImpl); + OpensslMacFree(mac); return HCF_ERR_CRYPTO_OPERATION; } OpensslMacFree(mac); -- Gitee