!438 修改内存泄漏问题

Merge pull request !438 from hhhFun/tdd
This commit is contained in:
openharmony_ci 2024-09-14 12:34:17 +00:00 committed by Gitee
commit 82acdbdc9c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 2 additions and 4 deletions

View File

@ -432,9 +432,9 @@ HcfResult BigIntegerToBigNum(const HcfBigInteger *src, BIGNUM **dest)
}
if (IsBigEndian()) {
*dest = OpensslBin2Bn((src->data), (src->len), NULL);
*dest = OpensslBin2Bn((src->data), (src->len), *dest);
} else {
*dest = OpensslLeBin2Bn((src->data), (src->len), NULL);
*dest = OpensslLeBin2Bn((src->data), (src->len), *dest);
}
if (*dest == NULL) {

View File

@ -33,8 +33,6 @@ static HcfResult BuildSm2Ciphertext(const Sm2CipherTextSpec *spec, struct Sm2Cip
LOGE("Build y failed.");
return HCF_ERR_CRYPTO_OPERATION;
}
sm2Text->c3 = OpensslAsn1OctetStringNew();
sm2Text->c2 = OpensslAsn1OctetStringNew();
if (sm2Text->c3 == NULL || sm2Text->c2 == NULL) {
LOGE("SM2 openssl [ASN1_OCTET_STRING_new] c3 c2 fail");
HcfPrintOpensslError();