mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-27 10:57:22 +08:00
Fixed crash if info->path is NULL
(cherry picked from commit 715301cef5)
This commit is contained in:
@@ -890,10 +890,8 @@ static SDL_HIDAPI_Device *HIDAPI_AddDevice(const struct SDL_hid_device_info *inf
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
device->magic = &SDL_HIDAPI_device_magic;
|
device->magic = &SDL_HIDAPI_device_magic;
|
||||||
device->path = SDL_strdup(info->path);
|
if (info->path) {
|
||||||
if (!device->path) {
|
device->path = SDL_strdup(info->path);
|
||||||
SDL_free(device);
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
device->seen = SDL_TRUE;
|
device->seen = SDL_TRUE;
|
||||||
device->vendor_id = info->vendor_id;
|
device->vendor_id = info->vendor_id;
|
||||||
|
|||||||
Reference in New Issue
Block a user