mirror of
https://gitee.com/openharmony/security_device_security_level
synced 2024-11-24 07:10:07 +00:00
fix: memory leak
Signed-off-by: lwk <1076278852@qq.com>
This commit is contained in:
parent
ac438f8870
commit
3d855f80f6
@ -343,7 +343,11 @@ static int32_t ParseNounceOfCertChain(const char *jsonBuffer, struct NounceOfCer
|
||||
|
||||
static void FreeNounceOfCertChain(struct NounceOfCertChain *nounce)
|
||||
{
|
||||
if (nounce != NULL && nounce->pbkInfoList != NULL)
|
||||
if (nounce == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (nounce->pbkInfoList != NULL)
|
||||
{
|
||||
FREE(nounce->pbkInfoList);
|
||||
nounce->pbkInfoList = NULL;
|
||||
@ -713,6 +717,7 @@ static int32_t verifySmallDslmCred(const DeviceIdentify *device, const DslmCredB
|
||||
(void)memset_s(credStr, credBuff->credLen + 1, 0, credBuff->credLen + 1);
|
||||
if (memcpy_s(credStr, credBuff->credLen + 1, credBuff->credVal, credBuff->credLen + 1) != EOK)
|
||||
{
|
||||
FREE(credStr);
|
||||
return ERR_MEMORY_ERR;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user