GVariant *out_param1;
request_info_t *req_info;
bluetooth_device_info_t dev_info;
- bt_remote_dev_info_t *remote_dev_info;
+ bt_remote_dev_info_t *remote_dev_info = NULL;
GVariant *manufacture_data;
GVariant *param;
goto dbus_return;
remote_dev_info = _bt_get_remote_device_info(bonding_info->addr);
+ if (NULL == remote_dev_info) {
+ BT_ERR("Failed to get remote device info");
+ goto dbus_return;
+ }
GVariant *uuids = NULL;
GVariantBuilder *builder = NULL;
/* Send the event to application */
- if (remote_dev_info != NULL) {
-
- _bt_send_event(BT_ADAPTER_EVENT,
- BLUETOOTH_EVENT_BONDING_FINISHED,
- param);
+ _bt_send_event(BT_ADAPTER_EVENT,
+ BLUETOOTH_EVENT_BONDING_FINISHED,
+ param);
- _bt_free_device_info(remote_dev_info);
- }
+ _bt_free_device_info(remote_dev_info);
dbus_return:
if (req_info->context == NULL)
GVariant *out_param1;
int result = BLUETOOTH_ERROR_NONE;
bluetooth_device_info_t dev_info;
- bt_remote_dev_info_t *remote_dev_info;
+ bt_remote_dev_info_t *remote_dev_info = NULL;
request_info_t *req_info;
GVariant *uuid_list, *manufacture_data;
GVariant *param;
}
remote_dev_info = _bt_get_remote_device_info(searching_info->addr);
+ if (NULL == remote_dev_info) {
+ BT_ERR("Failed to get remote device info");
+ goto dbus_return;
+ }
event:
builder = g_variant_builder_new(G_VARIANT_TYPE("as"));
/* Send the event to application */
- if (remote_dev_info != NULL) {
+ _bt_send_event(BT_ADAPTER_EVENT,
+ BLUETOOTH_EVENT_SERVICE_SEARCHED,
+ param);
- _bt_send_event(BT_ADAPTER_EVENT,
- BLUETOOTH_EVENT_SERVICE_SEARCHED,
- param);
-
- _bt_free_device_info(remote_dev_info);
- }
+ _bt_free_device_info(remote_dev_info);
dbus_return:
if (req_info->context == NULL)