diff --git a/channels/urbdrc/client/libusb/libusb_udevice.c b/channels/urbdrc/client/libusb/libusb_udevice.c index ffa9e7e27..36e667d4a 100644 --- a/channels/urbdrc/client/libusb/libusb_udevice.c +++ b/channels/urbdrc/client/libusb/libusb_udevice.c @@ -561,8 +561,7 @@ libusb_udev_complete_msconfig_setup(IUDEVICE* idev, MSUSB_CONFIG_DESCRIPTOR* MsC for (pnum = 0; pnum < LibusbNumEndpoint; pnum++) { - t_MsPipe = (MSUSB_PIPE_DESCRIPTOR*)malloc(sizeof(MSUSB_PIPE_DESCRIPTOR)); - memset(t_MsPipe, 0, sizeof(MSUSB_PIPE_DESCRIPTOR)); + t_MsPipe = (MSUSB_PIPE_DESCRIPTOR*)calloc(1, sizeof(MSUSB_PIPE_DESCRIPTOR)); if (pnum < MsInterface->NumberOfPipes && MsInterface->MsPipes) { @@ -863,12 +862,11 @@ static int libusb_udev_os_feature_descriptor_request(IUDEVICE* idev, UINT32 Requ BYTE* Buffer, int Timeout) { UDEVICE* pdev = (UDEVICE*)idev; - BYTE ms_string_desc[0x13]; + BYTE ms_string_desc[0x13] = { 0 }; int error = 0; /* pdev->request_queue->register_request(pdev->request_queue, RequestId, NULL, 0); */ - memset(ms_string_desc, 0, 0x13); error = libusb_control_transfer(pdev->libusb_handle, LIBUSB_ENDPOINT_IN | Recipient, LIBUSB_REQUEST_GET_DESCRIPTOR, 0x03ee, 0, ms_string_desc, 0x12, Timeout); diff --git a/channels/urbdrc/client/urbdrc_main.c b/channels/urbdrc/client/urbdrc_main.c index 6a6dd7502..2ed6a6f2e 100644 --- a/channels/urbdrc/client/urbdrc_main.c +++ b/channels/urbdrc/client/urbdrc_main.c @@ -86,7 +86,7 @@ static IWTSVirtualChannel* get_channel(IUDEVMAN* idevman) static int func_container_id_generate(IUDEVICE* pdev, char* strContainerId) { char *p, *path; - UINT8 containerId[17]; + UINT8 containerId[17] = { 0 }; UINT16 idVendor, idProduct; idVendor = (UINT16)pdev->query_device_descriptor(pdev, ID_VENDOR); idProduct = (UINT16)pdev->query_device_descriptor(pdev, ID_PRODUCT); @@ -97,7 +97,6 @@ static int func_container_id_generate(IUDEVICE* pdev, char* strContainerId) else p = path; - ZeroMemory(containerId, sizeof(containerId)); sprintf_s((char*)containerId, sizeof(containerId), "%04" PRIX16 "%04" PRIX16 "%s", idVendor, idProduct, p); /* format */