From: DoHyun Pyun Date: Wed, 17 Aug 2016 03:54:18 +0000 (+0900) Subject: Fill vcard name string in pulling vcard list X-Git-Tag: submit/tizen/20160818.005730~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a10642793e3a3d30fe2c8cc97739dcd0834be154;p=platform%2Fcore%2Fapi%2Fbluetooth.git Fill vcard name string in pulling vcard list Change-Id: I83aaeab899e60d5d2b9431f06a02a085b3f8306a Signed-off-by: DoHyun Pyun --- diff --git a/src/bluetooth-common.c b/src/bluetooth-common.c index 6aee504..8e58ead 100644 --- a/src/bluetooth-common.c +++ b/src/bluetooth-common.c @@ -1915,6 +1915,7 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us break; } case BLUETOOTH_PBAP_VCARD_LIST: { + int i; bt_pbap_list_vcards_cb cb = bt_event_slot_container[event_index].callback; void *user_data = bt_event_slot_container[event_index].user_data; bt_pbap_vcard_list_t *vc_list = (bt_pbap_vcard_list_t *)(param->param_data); @@ -1925,6 +1926,9 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us BT_INFO("BLUETOOTH_PBAP_VCARD_LIST"); + for (i = 0; i < vc_list->length; i++) + vcard_info[i].contact_name = g_strdup(vc_list->vcards[i]); + _bt_unset_cb(BT_EVENT_PBAP_VCARD_LIST); _bt_convert_address_to_string(&device_addr, &vc_list->btaddr); cb(_bt_get_error_code(param->result), device_addr, @@ -1934,8 +1938,11 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us if (device_addr != NULL) free(device_addr); - if (vcard_info != NULL) + if (vcard_info != NULL) { + for (i = 0; i < vc_list->length; i++) + g_free((char *)vcard_info[i].contact_name); free(vcard_info); + } break; }