diff --git a/libusb/hid.c b/libusb/hid.c index 705cd1ba7..abfeede43 100644 --- a/libusb/hid.c +++ b/libusb/hid.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -35,9 +36,6 @@ /* Unix */ #include #include -#include -#include -#include #include #include diff --git a/linux/hid.c b/linux/hid.c index a4dc26f4e..54165661c 100644 --- a/linux/hid.c +++ b/linux/hid.c @@ -26,24 +26,26 @@ #include #include #include - /* Unix */ #include -#include #include #include -#include #include #include +#include +#include +#include +#include /* Linux */ #include -#include #include #include #include "hidapi.h" +struct udev_device; + #ifdef HIDAPI_ALLOW_BUILD_WORKAROUND_KERNEL_2_6_39 /* This definitions first appeared in Linux Kernel 2.6.39 in linux/hidraw.h. hidapi doesn't support kernels older than that, @@ -616,10 +618,12 @@ static int parse_uevent_info(const char *uevent, unsigned *bus_type, } } else if (strcmp(key, "HID_NAME") == 0) { /* The caller has to free the product name */ + free(*product_name_utf8); *product_name_utf8 = strdup(value); found_name = 1; } else if (strcmp(key, "HID_UNIQ") == 0) { /* The caller has to free the serial number */ + free(*serial_number_utf8); *serial_number_utf8 = strdup(value); found_serial = 1; } diff --git a/mac/hid.c b/mac/hid.c index 2b7bcf8a7..4ec659523 100644 --- a/mac/hid.c +++ b/mac/hid.c @@ -29,12 +29,15 @@ #include #include #include +#include +#include #include #include #include #include #include #include +#include #include "hidapi_darwin.h"