fixed SVACE issue 86/125886/3 accepted/tizen/unified/20170419.165404 submit/tizen/20170419.083715 tizen_4.0.m1_release
authorjomui <jongmun.woo@samsung.com>
Wed, 19 Apr 2017 08:13:58 +0000 (17:13 +0900)
committerjomui <jongmun.woo@samsung.com>
Wed, 19 Apr 2017 08:30:11 +0000 (17:30 +0900)
Signed-off-by: jomui <jongmun.woo@samsung.com>
Change-Id: I33162edf1b1ebc0af25b19f47d83f7bdbaaf515c

geofence-server/src/geofence_server.c

index de56328..68d45ea 100644 (file)
@@ -243,11 +243,15 @@ void bt_le_scan_result_display_cb(int result, bt_adapter_le_device_scan_result_i
                        }
                        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);
                }