diff --git a/windows/hid.c b/windows/hid.c index b94f64a..04ffb11 100644 --- a/windows/hid.c +++ b/windows/hid.c @@ -862,7 +862,10 @@ HID_API_EXPORT hid_device * HID_API_CALL hid_open_path(const char *path) end_of_function: CloseHandle(device_handle); - HidD_FreePreparsedData(pp_data); + + if (pp_data) { + HidD_FreePreparsedData(pp_data); + } return dev; }