mirror of
https://github.com/RPCS3/hidapi.git
synced 2024-11-26 19:40:35 +00:00
hid_open_path: Don't pass invalid pointers to HidD_FreePreparsedData
Fixes a segfault that happens when hid_open_path is called on a previously disconnected device.
This is a regression caused by:
b600727
- Win32: Fix memory leak in `free_hid_device` (#361)
This commit is contained in:
parent
cdeb14a4e5
commit
6cf133697c
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user