X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=bt-oal%2Fbluez_hal%2Fsrc%2Fbt-hal-mesh-dbus-handler.c;h=0b9f872179366628fca40ab073e6202f303cb609;hb=6a51b5737e8f042572c807980bfa806093cb95cf;hp=e1d12b09aef1d6b0ad963060f25bb2695851b75f;hpb=430fe6971deca44cbbf9965219ec7852972f7af9;p=platform%2Fcore%2Fconnectivity%2Fbluetooth-frwk.git diff --git a/bt-oal/bluez_hal/src/bt-hal-mesh-dbus-handler.c b/bt-oal/bluez_hal/src/bt-hal-mesh-dbus-handler.c index e1d12b0..0b9f872 100644 --- a/bt-oal/bluez_hal/src/bt-hal-mesh-dbus-handler.c +++ b/bt-oal/bluez_hal/src/bt-hal-mesh-dbus-handler.c @@ -1419,6 +1419,10 @@ static struct l_dbus_message *__mesh_agent_prompt_numeric_request( l = g_slist_find_custom(mesh_apps, net_uuid, __mesh_compare_network_uuid); + if (!l) { + g_free(net_uuid); + return NULL; + } app = l->data; memset(&ev, 0, sizeof(ev)); @@ -1464,7 +1468,7 @@ static struct l_dbus_message *__mesh_agent_prompt_static_request( uint8_t *net_uuid; const char *dbus_path; GSList *l; - meshcfg_app *app; + meshcfg_app *app = NULL; dbus_path = l_dbus_message_get_path(msg); net_uuid = __mesh_get_net_uuid_from_path(dbus_path, true, @@ -1474,7 +1478,13 @@ static struct l_dbus_message *__mesh_agent_prompt_static_request( l = g_slist_find_custom(mesh_apps, net_uuid, __mesh_compare_network_uuid); - app = l->data; + + if (l) { + app = l->data; + } else { + ERR("Mesh: app not found"); + } + memset(&ev, 0, sizeof(ev)); memcpy(ev.net_uuid, net_uuid, 16); @@ -1485,7 +1495,10 @@ static struct l_dbus_message *__mesh_agent_prompt_static_request( struct hal_ev_mesh_provision_finished ev; memset(&ev, 0, sizeof(ev)); - memcpy(ev.net_uuid, app->uuid, 16); + + if (app) + memcpy(ev.net_uuid, app->uuid, 16); + ev.status = BT_STATUS_FAIL; ev.reason = BT_HAL_MESH_PROV_ERR_INTERNAL; if (mesh_event_cb) @@ -1782,6 +1795,8 @@ void __bt_mesh_enable_scanning_timer(uint8_t *net_uuid, uint16_t secs) meshcfg_app *app; l = g_slist_find_custom(mesh_apps, net_uuid, __mesh_compare_network_uuid); + if (!l) + return; app = l->data; if (app->scan_timer_id > 0) { @@ -2309,7 +2324,6 @@ static void __bt_hal_mesh_delete_node_setup(struct l_dbus_message *msg, l_dbus_message_set_arguments(msg, "qy", node_info->unicast, node_info->num_elements); INFO("Mesh: Delete Remote Node Setup params passed"); - g_free(node_info); } static void __bt_hal_mesh_delete_node_reply(