mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-03 08:28:29 +00:00
Fix use after free in SDL_GetGamepads
This commit is contained in:

committed by
Sam Lantinga

parent
5cf55c4f28
commit
ea6f0ae683
@@ -1928,7 +1928,6 @@ SDL_JoystickID *SDL_GetGamepads(int *count)
|
||||
SDL_memmove(&joysticks[i], &joysticks[i+1], (num_gamepads + 1) * sizeof(joysticks[i]));
|
||||
}
|
||||
}
|
||||
SDL_free(joysticks);
|
||||
}
|
||||
if (count) {
|
||||
*count = num_gamepads;
|
||||
|
Reference in New Issue
Block a user