Commit 5556bfb1 authored by Sam Lantinga's avatar Sam Lantinga

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.

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403869
parent 214b2485
...@@ -1191,8 +1191,8 @@ void SDL_SYS_JoystickQuit(void) ...@@ -1191,8 +1191,8 @@ void SDL_SYS_JoystickQuit(void)
for ( i=0; SDL_joylist[i].fname; ++i ) { for ( i=0; SDL_joylist[i].fname; ++i ) {
SDL_free(SDL_joylist[i].fname); SDL_free(SDL_joylist[i].fname);
SDL_joylist[i].fname = NULL;
} }
SDL_joylist[0].fname = NULL;
} }
#endif /* SDL_JOYSTICK_LINUX */ #endif /* SDL_JOYSTICK_LINUX */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment