mirror of https://github.com/libsdl-org/SDL.git
Fixed crash if info->path is NULL
(cherry picked from commit715301cef5) (cherry picked from commit46a51b4298)
This commit is contained in:
parent
c8c4c97727
commit
d3bb91522f
|
|
@ -890,10 +890,8 @@ static SDL_HIDAPI_Device *HIDAPI_AddDevice(const struct SDL_hid_device_info *inf
|
|||
return NULL;
|
||||
}
|
||||
device->magic = &SDL_HIDAPI_device_magic;
|
||||
if (info->path) {
|
||||
device->path = SDL_strdup(info->path);
|
||||
if (!device->path) {
|
||||
SDL_free(device);
|
||||
return NULL;
|
||||
}
|
||||
device->seen = SDL_TRUE;
|
||||
device->vendor_id = info->vendor_id;
|
||||
|
|
|
|||
Loading…
Reference in New Issue