Fill vcard name string in pulling vcard list 38/84138/1
authorDoHyun Pyun <dh79.pyun@samsung.com>
Wed, 17 Aug 2016 03:54:18 +0000 (12:54 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Wed, 17 Aug 2016 03:54:18 +0000 (12:54 +0900)
Change-Id: I83aaeab899e60d5d2b9431f06a02a085b3f8306a
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
src/bluetooth-common.c

index 6aee504a6c856cb4ba3816d84093c83178d56888..8e58eada06df2dcf2208510bdf81ea5402f59e87 100644 (file)
@@ -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;
        }