Fix use after free in SDL_GetGamepads

This commit is contained in:
Mathieu Eyraud
2023-01-02 09:03:49 -08:00
committed by Sam Lantinga
parent 5cf55c4f28
commit ea6f0ae683
-1
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_free(joysticks);
}
if (count) {
*count = num_gamepads;