[BT-Service] Fix Coverity issues
[platform/core/connectivity/bluetooth-frwk.git] / bt-service-adaptation / services / gatt / bt-service-gatt.c
index e5c306c..fda8ba5 100644 (file)
@@ -2986,6 +2986,7 @@ static void __bt_handle_client_disconnected(event_gattc_conn_t *event_data)
                        __bt_gatt_handle_pending_request_info(result, BT_CONNECT_LE,
                                        address, BT_ADDRESS_STRING_SIZE);
                        BT_ERR("Failed to connect Local GATT Remote addr[%s]", address);
+                       g_free(address);
                        return;
                }
        } else {
@@ -3208,7 +3209,8 @@ static void __bt_handle_client_characteristic_search_result(
                        svc_info->chars = g_slist_append(svc_info->chars, char_info);
                } else {
                        /* If found, then return */
-                       BT_INFO("Characteristic browsed is already presesnt");
+                       BT_INFO("update char property as Characteristic browsed is already present");
+                       char_info->props |= event_data->char_prop;
                }
        } else {
                /* If Not success: Means Charc browse is completed  */
@@ -3766,6 +3768,7 @@ static void __bt_hanlde_le_device_disconnection(event_dev_conn_status_t *event_d
 
        __bt_gatt_handle_pending_request_info(result, BT_CONNECT_LE, address,
                                                 BT_ADDRESS_STRING_SIZE);
+       g_free(address);
 }
 
 static void __bt_handle_client_notification_registered(