mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-25 09:17:12 +01:00
Fixed bug 5168 - Memory leak in RAWINPUT_JoystickOpen
meyraud705 Variable 'hwdata' is not freed in RAWINPUT_JoystickOpen if device->driver->OpenJoystick() fails.
This commit is contained in:
parent
134362e745
commit
eea0b0e088
@ -592,8 +592,8 @@ RAWINPUT_JoystickOpen(SDL_Joystick * joystick, int device_index)
|
||||
}
|
||||
|
||||
if (!device->driver->OpenJoystick(&device->hiddevice, joystick)) {
|
||||
/* Only possible error is out of memory */
|
||||
return SDL_OutOfMemory();
|
||||
SDL_free(hwdata);
|
||||
return -1;
|
||||
}
|
||||
|
||||
hwdata->reserved = (void*)-1; /* crash if some code slips by that tries to use this */
|
||||
|
Loading…
Reference in New Issue
Block a user