From 3b18c796ed6f438e9fcde6574d0bf61c3deb8edc Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 9 Dec 2016 01:29:52 -0800 Subject: [PATCH] Fixed bug 3512 - Memory leak of SDL_Joystick axes_zero array Benjamin Harris Found with valgrind and confirmed in the 2.0.5 source code. One-line fix in SDL_JoystickClose? --- src/joystick/SDL_joystick.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index 05e8175f744af..21e1365c4cf6a 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -486,6 +486,7 @@ SDL_JoystickClose(SDL_Joystick * joystick) /* Free the data associated with this joystick */ SDL_free(joystick->axes); + SDL_free(joystick->axes_zero); SDL_free(joystick->hats); SDL_free(joystick->balls); SDL_free(joystick->buttons);