Fix coverity issue 96/262296/1 accepted/tizen/6.5/unified/20211028.095929 accepted/tizen/unified/20210823.124243 submit/tizen/20210806.053226 submit/tizen/20210820.043301 submit/tizen_6.5/20211028.162201 tizen_6.5.m2_release
authorWootak Jung <wootak.jung@samsung.com>
Fri, 6 Aug 2021 05:21:40 +0000 (14:21 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Fri, 6 Aug 2021 05:21:40 +0000 (14:21 +0900)
param should be initialized

Change-Id: I5da0ab3ad7f6a74322038b97357e7141f2983ac3
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
bt-service/services/gatt/bt-service-gatt.c

index bf93e24..83fed75 100644 (file)
@@ -1009,6 +1009,7 @@ static void __bt_gatt_cleanup_invocation_on_gatt_disconnection(int result,
                case BT_GATT_GET_PRIMARY_SERVICES: {
                        if(!g_strcmp0((char*)req_info->user_data, (char*)data)){
                                bt_services_browse_info_t param;
+                               memset(&param, 0, sizeof(bt_services_browse_info_t));
                                _bt_convert_addr_string_to_type(param.device_addr.addr, (char*)data);
                                out_param = g_array_new(FALSE, FALSE, sizeof(gchar));
                                g_array_append_vals(out_param, &param, sizeof(bt_services_browse_info_t));
@@ -1024,6 +1025,7 @@ static void __bt_gatt_cleanup_invocation_on_gatt_disconnection(int result,
                        _bt_convert_addr_type_to_string(addr, prop->device_address.addr);
                        if (!g_strcmp0(addr, (char*)data)){
                                bt_char_browse_info_t param;
+                               memset(&param, 0, sizeof(bt_char_browse_info_t));
                                _bt_convert_addr_string_to_type(param.device_addr.addr,addr);
                                out_param = g_array_new(FALSE, FALSE, sizeof(gchar));
                                g_array_append_vals(out_param, &param, sizeof(bt_char_browse_info_t));
@@ -1038,7 +1040,8 @@ static void __bt_gatt_cleanup_invocation_on_gatt_disconnection(int result,
                        bluetooth_gatt_client_char_prop_info_t *prop = (bluetooth_gatt_client_char_prop_info_t*)req_info->user_data;
                        _bt_convert_addr_type_to_string(addr, prop->device_address.addr);
                        if (!g_strcmp0(addr, (char*)data)){
-                               bt_descriptor_browse_info_t param ;
+                               bt_descriptor_browse_info_t param;
+                               memset(&param, 0, sizeof(bt_descriptor_browse_info_t));
                                _bt_convert_addr_string_to_type(param.device_addr.addr, addr);
                                out_param = g_array_new(FALSE, FALSE, sizeof(gchar));
                                g_array_append_vals(out_param, &param, sizeof(bt_descriptor_browse_info_t));
@@ -1054,6 +1057,7 @@ static void __bt_gatt_cleanup_invocation_on_gatt_disconnection(int result,
                        _bt_convert_addr_type_to_string(addr, prop->device_address.addr);
                        if (!g_strcmp0(addr, (char*)data)){
                                bt_gatt_notif_reg_info_t param;
+                               memset(&param, 0, sizeof(bt_gatt_notif_reg_info_t));
                                _bt_convert_addr_string_to_type(param.addr.addr, addr);
                                out_param = g_array_new(FALSE, FALSE, sizeof(gchar));
                                g_array_append_vals(out_param, &param, sizeof(bt_gatt_notif_reg_info_t));