}
cred->credUsage= (char *)OICCalloc(1, strlen(TRUST_CA)+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__);
+ OICFree(cred);
+ return OC_STACK_NO_MEMORY;
+ }
OICStrcpy(cred->credUsage, strlen(TRUST_CA) + 1, TRUST_CA);
cred->credType = SIGNED_ASYMMETRIC_KEY;
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__);
+ OICFree(cred);
+ return OC_STACK_NO_MEMORY;
+ }
OICStrcpy(cred->credUsage, strlen(PRIMARY_CERT) + 1, PRIMARY_CERT) ;
cred->credType = SIGNED_ASYMMETRIC_KEY;
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__);
+ OICFree(publicData->data);
+ return OC_STACK_NO_MEMORY;
+ }
memcpy(privateData->data, key->data, key->len);
privateData->len = key->len;
privateData->encoding = key->encoding;
if (OC_STACK_OK != result)
{
OIC_LOG_V(ERROR, TAG, "SendDeleteCredentialRequest : encoding error %d\n", result);
+ OICFree(subID);
return OC_STACK_ERROR;
}
destDev->endpoint.addr);
if (OC_STACK_OK != result)
{
+ OICFree(subID);
OIC_LOG_V(ERROR, TAG, "SendDeleteCredentialRequest : encoding error %d\n", result);
return OC_STACK_ERROR;
}