summaryrefslogtreecommitdiff
path: root/libusb/os/windows_usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'libusb/os/windows_usb.c')
-rw-r--r--libusb/os/windows_usb.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c
index 97a1e56..a0e448a 100644
--- a/libusb/os/windows_usb.c
+++ b/libusb/os/windows_usb.c
@@ -1513,7 +1513,10 @@ static int set_device_paths(struct libusb_context *ctx, struct discovered_devs *
break;
default:
// For other devices, the first interface is the same as the device
- priv->usb_interface[0].path = safe_strdup(priv->path); // needs strdup
+ priv->usb_interface[0].path = malloc(safe_strlen(priv->path));
+ if (priv->usb_interface[0].path != NULL) {
+ safe_strcpy(priv->usb_interface[0].path, safe_strlen(priv->path), priv->path);
+ }
// The following is needed if we want to API calls to work for both simple
// and composite devices, as
for(k=0; k<USB_MAXINTERFACES; k++) {
@@ -4237,4 +4240,4 @@ static int composite_copy_transfer_data(struct usbi_transfer *itransfer, uint32_
struct windows_device_priv *priv = __device_priv(transfer->dev_handle->dev);
return priv->usb_interface[transfer_priv->interface_number].apib->copy_transfer_data(itransfer, io_size);
-}
+} \ No newline at end of file