Fix use after free in SDL_GetGamepads

main
Mathieu Eyraud 2023-01-02 10:20:44 +01:00 committed by Sam Lantinga
parent 5cf55c4f28
commit ea6f0ae683
1 changed files with 0 additions and 1 deletions

View File

@ -1928,7 +1928,6 @@ SDL_JoystickID *SDL_GetGamepads(int *count)
SDL_memmove(&joysticks[i], &joysticks[i+1], (num_gamepads + 1) * sizeof(joysticks[i])); SDL_memmove(&joysticks[i], &joysticks[i+1], (num_gamepads + 1) * sizeof(joysticks[i]));
} }
} }
SDL_free(joysticks);
} }
if (count) { if (count) {
*count = num_gamepads; *count = num_gamepads;