OIC_LOG_V(DEBUG, TAG, "Connected to [%s] ", remoteAddress);
char *addr = OICStrdup(remoteAddress);
+ if (NULL == addr)
+ {
+ OIC_LOG(ERROR, TAG, "addr is NULL");
+ return;
+ }
ca_mutex_lock(g_LEClientThreadPoolMutex);
if (NULL == g_LEClientThreadPool)
{
g_deviceDiscoveredList = u_arraylist_create();
}
+
char *deviceAddr = OICStrdup(scanInfo->remote_address);
+ if (NULL == deviceAddr)
+ {
+ OIC_LOG_V(ERROR, TAG, "Device address is NULL");
+ ca_mutex_unlock(g_deviceDiscoveredListMutex);
+ return;
+ }
+
u_arraylist_add(g_deviceDiscoveredList, (void *) deviceAddr);
ca_mutex_unlock(g_deviceDiscoveredListMutex);
//TODO: This data has to be freed while unsetting the callback.
char *addr = OICStrdup(remoteAddress);
+ if (NULL == addr)
+ {
+ OIC_LOG(ERROR, TAG, "addr is NULL");
+ bt_gatt_client_destroy(clientHandle);
+ CALEGattDisConnect(remoteAddress);
+ return CA_STATUS_FAILED;
+ }
+
ret = bt_gatt_client_set_characteristic_value_changed_cb(readChrHandle,
CALEGattCharacteristicChangedCb,
(void *)addr);