} else {
bssidlen = strlen(ap_bssid);
LOGI_GEOFENCE("Connected AP: %s, %d\n", ap_bssid, bssidlen);
- if (g_strcmp0(wifi_info->bssid, ap_bssid) == 0) {
+ if (g_strcmp0(wifi_info->bssid, ap_bssid) == 0) {
status_to_be_emitted = GEOFENCE_FENCE_STATE_IN;
geofence_server->connectedTrackingWifiFenceId = fence_id;
} else {
}
}
+ if (ap_bssid != NULL)
+ free(ap_bssid);
+ ap_bssid = NULL;
}
} else {
LOGI_GEOFENCE("Wifi is not switched on...");
state = GEOFENCE_PROXIMITY_FAR;
emit_wifi_geofence_proximity_changed(geofence_server, geofence_server->connectedTrackingWifiFenceId, state);
}
+ if (bssid != NULL)
+ free(bssid);
+ bssid = NULL;
}
}
LOGD_GEOFENCE("exit");
}
-void __geofence_check_wifi_matched_bssid(wifi_connection_state_e state, char *bssid, void *user_data)
+void __geofence_check_wifi_matched_bssid(wifi_connection_state_e state, char *bssid, void *user_data)
{
LOGD_GEOFENCE("Comparing the matching bssids");
GeofenceServer *geofence_server = (GeofenceServer *)user_data;
LOGD_GEOFENCE("Wifi disconnected with [%s].", ap_bssid);
__geofence_check_wifi_matched_bssid(state, ap_bssid, user_data);
}
+ if (ap_bssid != NULL)
+ free(ap_bssid);
+ ap_bssid = NULL;
}