return value of 'OICCalloc' function is dereferenced
at cainterfacecontroller.c
Change-Id: I7c6513c72fe0e0f4ec24121cdc9e3e78ffa0cb41
Signed-off-by: hyuna0213.jo <hyuna0213.jo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/5143
Reviewed-by: jihwan seo <jihwan.seo@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
}
CAEndpoint_t **tempInfo = (CAEndpoint_t**) OICCalloc(g_numberOfAdapters, sizeof(*tempInfo));
+ if (!tempInfo)
+ {
+ OIC_LOG(ERROR, TAG, "Out of memory!");
+ return CA_MEMORY_ALLOC_FAILED;
+ }
uint32_t *tempSize =(uint32_t*) OICCalloc(g_numberOfAdapters, sizeof(*tempSize));
+ if (!tempSize)
+ {
+ OIC_LOG(ERROR, TAG, "Out of memory!");
+ OICFree(tempInfo);
+ return CA_MEMORY_ALLOC_FAILED;
+ }
CAResult_t res = CA_STATUS_FAILED;
size_t resSize = 0;