Fix issue where bonded_device was null when create bond failed, causing
a crash when passed to C#.
Change-Id: I82d4d4f8c51ebec90e7f89adb94093dec9bda85d
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
BT_INFO("bt_device_bond_created_cb() will be called");
_bt_get_bt_device_info_s(&bonded_device, (bluetooth_device_info_t *)(param->param_data));
+ if (bonded_device == NULL) {
+ bonded_device = (bt_device_info_s *)malloc(sizeof(bt_device_info_s));
+ if (bonded_device != NULL)
+ memset(bonded_device, 0x00, sizeof(bt_device_info_s));
+ }
+
((bt_device_bond_created_cb)bt_event_slot_container[event_index].callback)
(_bt_get_error_code(param->result), bonded_device, bt_event_slot_container[event_index].user_data);
_bt_free_bt_device_info_s(bonded_device);