}
if (ble_proximity_mode == BLE_INFO_READ) {
geofence_manager_get_ble_info_from_geofence(fence_id, &ble_info);
- LOGI_GEOFENCE("Ble info read from DB: %s", ble_info);
- if (__check_for_match(ble_info, info->remote_address)) {
- LOGI_GEOFENCE("Matched for ble address: %s for the fence: %d", info->remote_address, fence_id);
- emit_proximity_using_ble(geofence_server, fence_id, GEOFENCE_PROXIMITY_IMMEDIATE);
+ if (ble_info != NULL) {
+ LOGI_GEOFENCE("Ble info read from DB: %s", ble_info);
+ if (__check_for_match(ble_info, info->remote_address)) {
+ LOGI_GEOFENCE("Matched for ble address: %s for the fence: %d", info->remote_address, fence_id);
+ emit_proximity_using_ble(geofence_server, fence_id, GEOFENCE_PROXIMITY_IMMEDIATE);
+ }
+ g_free(ble_info);
}
+ ble_info = NULL;
}
tracking_list = g_list_next(tracking_list);
}