Commit feab9d42c1fa71ff3de5da79fabc305b7c87a4dd

Sam Lantinga 2020-11-24T06:40:13

5363 - Memory leak of joystick->sensors in SDL_JoystickClose Mathieu Eyraud Joystick->sensors is never freed.

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c
index 35b87c8..d03c7a4 100644
--- a/src/joystick/SDL_joystick.c
+++ b/src/joystick/SDL_joystick.c
@@ -1036,6 +1036,7 @@ SDL_JoystickClose(SDL_Joystick *joystick)
         SDL_free(touchpad->fingers);
     }
     SDL_free(joystick->touchpads);
+    SDL_free(joystick->sensors);
     SDL_free(joystick);
 
     SDL_UnlockJoysticks();