Fix the svace issue - DEREF_AFTER_NULL
[platform/core/connectivity/bluetooth-frwk.git] / bt-api / bt-gatt-client.c
index 887870f..13eea3c 100644 (file)
@@ -50,8 +50,6 @@ static GSList *service_monitor_list = NULL;
 
 BT_EXPORT_API int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty)
 {
-       BT_DBG("+");
-
        BT_CHECK_PARAMETER(svc_pty, return);
 
 #ifdef TIZEN_GATT_CLIENT
@@ -65,14 +63,11 @@ BT_EXPORT_API int bluetooth_gatt_free_service_property(bt_gatt_service_property_
 
        memset(svc_pty, 0, sizeof(bt_gatt_service_property_t));
 
-       BT_DBG("-");
        return BLUETOOTH_ERROR_NONE;
 }
 
 BT_EXPORT_API int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty)
 {
-       BT_DBG("+");
-
        BT_CHECK_PARAMETER(char_pty, return);
 
        g_free(char_pty->uuid);
@@ -86,14 +81,11 @@ BT_EXPORT_API int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *cha
 
        memset(char_pty, 0, sizeof(bt_gatt_char_property_t));
 
-       BT_DBG("-");
        return BLUETOOTH_ERROR_NONE;
 }
 
 BT_EXPORT_API int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty)
 {
-       BT_DBG("+");
-
        BT_CHECK_PARAMETER(desc_pty, return);
 
        g_free(desc_pty->uuid);
@@ -104,7 +96,6 @@ BT_EXPORT_API int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_prop
 
        memset(desc_pty, 0, sizeof(bt_gatt_char_descriptor_property_t));
 
-       BT_DBG("-");
        return BLUETOOTH_ERROR_NONE;
 }
 
@@ -133,24 +124,16 @@ gboolean _bluetooth_gatt_check_service_change_watcher_address(
 {
        GSList *l;
        char device_address[BT_ADDRESS_STRING_SIZE] = { 0 };
-       char secure_address[BT_ADDRESS_STRING_SIZE] = { 0 };
 
        _bt_convert_addr_type_to_string(device_address,
                        (unsigned char *)device_addr->addr);
 
        for (l = service_monitor_list; l != NULL; l = l->next) {
                char device_address2[BT_ADDRESS_STRING_SIZE] = { 0 };
-               char secure_address2[BT_ADDRESS_STRING_SIZE] = { 0 };
                bluetooth_device_address_t *addr = l->data;
 
                _bt_convert_addr_type_to_string(device_address2,
                                (unsigned char *)addr->addr);
-               _bt_convert_addr_string_to_secure_string(secure_address,
-                               device_address);
-               _bt_convert_addr_string_to_secure_string(secure_address2,
-                               device_address2);
-               BT_INFO("service_monitor_list [%s] - Input [%s]",
-                               secure_address2, secure_address);
 
                if (!memcmp(device_addr, addr,
                            sizeof(bluetooth_device_address_t)))
@@ -1874,7 +1857,7 @@ static void __bt_fill_char_handle_informations(bt_char_browse_info_t *props, bt_
 
        /* Now fill all the char handles [UUID and Instance ID's]*/
        for (count = 0; count < props->count; count++) {
-               BT_INFO("[%d] %s  instance_id [%d] properties [%d]",
+               BT_DBG("[%d] %s  instance_id [%d] properties [%d]",
                                count, props->uuids[count], props->inst_id[count], props->props[count]);
 
                g_strlcpy(service->char_handle.uuids[count],
@@ -1899,7 +1882,7 @@ static void __bt_fill_desc_handle_informations(bt_descriptor_browse_info_t *prop
 
        /* Now fill all the descriptor handles [UUID and Instance ID's]*/
        for (count = 0; count < props->count; count++) {
-               BT_INFO("[%d] %s  instance_id [%d]",
+               BT_DBG("[%d] %s  instance_id [%d]",
                                count, props->uuids[count], props->inst_id[count]);
 
                g_strlcpy(charc->char_desc_handle.uuids[count],
@@ -2366,7 +2349,7 @@ BT_EXPORT_API int bluetooth_gatt_client_watch_characteristics(
                        int fd = -1;
 
                        fd_list_array = g_unix_fd_list_steal_fds(out_fd_list, &len);
-                       BT_INFO("Num fds in fd_list is : %d, fd_list[0]: %d", len, fd_list_array[0]);
+                       BT_DBG("Num fds in fd_list is : %d, fd_list[0]: %d", len, fd_list_array[0]);
                        fd = fd_list_array[0];
                        mtu =  g_array_index(out_param, int, 0);
 
@@ -2504,7 +2487,9 @@ static gboolean  bluetooth_gatt_client_write_channel_watch_cb(GIOChannel *gio,
                return FALSE;
 
        if (cond & (G_IO_NVAL | G_IO_HUP | G_IO_ERR)) {
-               BT_ERR("Error : GIOCondition %d, [%s]", cond, chr_info->UUID);
+               char  uuid_str[37];
+               _bt_convert_uuid_type_to_string(uuid_str, chr_info->UUID);
+               BT_ERR("Error : GIOCondition %d, [%s]", cond, uuid_str);
                g_io_channel_shutdown(gio, TRUE, NULL);
                g_io_channel_unref(gio);
 
@@ -2806,8 +2791,6 @@ BT_EXPORT_API int bluetooth_gatt_client_deinit(
 
        if (result != BLUETOOTH_ERROR_NONE)
                BT_ERR("GATT Client Unregistration failed result [%d]", result);
-       else
-               BT_INFO("GATT Client Unregistration successful");
 
        /* Unregister event handler if this is the only instance */
        event_info = _bt_event_get_cb_data(BT_GATT_CLIENT_EVENT);
@@ -2815,7 +2798,7 @@ BT_EXPORT_API int bluetooth_gatt_client_deinit(
        if (event_info) {
                count = (int*)event_info->user_data;
 
-               BT_INFO("Total num of GATT client instances [%d]", *count);
+               BT_DBG("Total num of GATT client instances [%d]", *count);
 
                if (*count == 1) {
                        BT_DBG("Currently only one GATT client instance, so remove it and unregister GATT client events");