- char *addr = OICStrdup(remoteAddress);
- if (NULL == addr)
- {
- oc_mutex_unlock(g_LEServerListMutex);
- OIC_LOG(ERROR, TAG, "Device address is NULL");
- return CA_STATUS_FAILED;
- }
- serverInfo = (LEServerInfo *)OICCalloc(1, sizeof(LEServerInfo));
- if (NULL == serverInfo)
- {
- oc_mutex_unlock(g_LEServerListMutex);
- OIC_LOG(ERROR, TAG, "Calloc failed");
- OICFree(addr);
- return CA_STATUS_FAILED;
- }
- serverInfo->remoteAddress = addr;
- serverInfo->status = LE_STATUS_UNICAST_PENDING;
-
- if (CA_STATUS_OK != CAAddLEServerInfoToList(&g_LEServerList, serverInfo))
- {
- oc_mutex_unlock(g_LEServerListMutex);
- OIC_LOG_V(ERROR, TAG, "Could not add [%s] to server list", remoteAddress);
- CAFreeLEServerInfo(serverInfo);
- return CA_STATUS_FAILED;
- }
-