if (encodingType == OIC_ENCODING_PEM)
{
cred->optionalData.data = (uint8_t *)OICCalloc(1, chainSize + 1);
- VERIFY_NON_NULL_RET(TAG, cred->optionalData.data, ERROR, OC_STACK_NO_MEMORY);
+ if (cred->optionalData.data == NULL)
+ {
+ OIC_LOG_V(ERROR, TAG, "%s cant alloc cred->optionalData.data", __func__);
+ OICFree(cred);
+ return OC_STACK_NO_MEMORY;
+ }
cred->optionalData.len = chainSize + 1;
}
else
}
cred->credUsage= (char *)OICCalloc(1, strlen(PRIMARY_CERT)+1 );
- VERIFY_NON_NULL_RET(TAG, cred->credUsage, ERROR, OC_STACK_NO_MEMORY);
if (cred->credUsage == NULL)
{
OIC_LOG_V(ERROR, TAG, "%s cant alloc credUsage", __func__);
OicSecKey_t *privateData = &cred->privateData;
privateData->data = (uint8_t *)OICCalloc(1, key->len);
- VERIFY_NON_NULL_RET(TAG, privateData->data, ERROR, OC_STACK_NO_MEMORY);
if (privateData->data == NULL)
{
OIC_LOG_V(ERROR, TAG, "%s cant alloc publicData->data", __func__);