Mercurial > sdl-ios-xcode
comparison src/joystick/linux/SDL_sysjoystick.c @ 4226:dbdf8b108e31 SDL-1.2
Fixed bug #638
Philipp Nordhus 2008-11-05 13:56:33 PST
The Linux version of SDL_SYS_JoystickQuit() tries to free an invalid pointer
when the number of joysticks was reduced since the last call.
Reproduce: Connect two joysticks, call SDL_Init() and SDL_Quit(), then
disconnect one joystick and call the functions again.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 21 Sep 2009 11:34:50 +0000 |
parents | cc865a058a0c |
children | 0530394b5830 |
comparison
equal
deleted
inserted
replaced
4225:6c1d2039b6b4 | 4226:dbdf8b108e31 |
---|---|
1189 { | 1189 { |
1190 int i; | 1190 int i; |
1191 | 1191 |
1192 for ( i=0; SDL_joylist[i].fname; ++i ) { | 1192 for ( i=0; SDL_joylist[i].fname; ++i ) { |
1193 SDL_free(SDL_joylist[i].fname); | 1193 SDL_free(SDL_joylist[i].fname); |
1194 } | 1194 SDL_joylist[i].fname = NULL; |
1195 SDL_joylist[0].fname = NULL; | 1195 } |
1196 } | 1196 } |
1197 | 1197 |
1198 #endif /* SDL_JOYSTICK_LINUX */ | 1198 #endif /* SDL_JOYSTICK_LINUX */ |