mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-26 07:48:42 +00:00
Fixed crash if info->path is NULL
(cherry picked from commit 715301cef5)
This commit is contained in:
parent
3e34720851
commit
3f13c0b36d
1 changed files with 2 additions and 4 deletions
|
|
@ -868,10 +868,8 @@ static SDL_HIDAPI_Device *HIDAPI_AddDevice(const struct SDL_hid_device_info *inf
|
|||
return NULL;
|
||||
}
|
||||
SDL_SetObjectValid(device, SDL_OBJECT_TYPE_HIDAPI_JOYSTICK, true);
|
||||
device->path = SDL_strdup(info->path);
|
||||
if (!device->path) {
|
||||
SDL_free(device);
|
||||
return NULL;
|
||||
if (info->path) {
|
||||
device->path = SDL_strdup(info->path);
|
||||
}
|
||||
device->seen = true;
|
||||
device->vendor_id = info->vendor_id;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue