Fix the coverity issue (Resource leak)
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / bt-service-hid.c
index b691f5a..28e47f7 100644 (file)
@@ -179,9 +179,6 @@ int _bt_hid_connect(int request_id,
        _bt_convert_addr_type_to_string(address, device_address->addr);
 
        func_data = g_malloc0(sizeof(bt_function_data_t));
-       /* Fix : NULL_RETURNS */
-       retv_if(func_data == NULL, BLUETOOTH_ERROR_MEMORY_ALLOCATION);
-
        func_data->address = g_strdup(address);
        func_data->req_id = request_id;
        uuid = HID_UUID;
@@ -218,9 +215,6 @@ int _bt_hid_disconnect(int request_id,
        _bt_convert_addr_type_to_string(address, device_address->addr);
 
        func_data = g_malloc0(sizeof(bt_function_data_t));
-       /* Fix : NULL_RETURNS */
-       retv_if(func_data == NULL, BLUETOOTH_ERROR_MEMORY_ALLOCATION);
-
        func_data->address = g_strdup(address);
        func_data->req_id = request_id;
 
@@ -244,4 +238,3 @@ int _bt_hid_enable_barcode_feature(void)
 
        return BLUETOOTH_ERROR_NONE;
 }
-