Skip to content

Commit

Permalink
Fixed bug #638
Browse files Browse the repository at this point in the history
 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.
  • Loading branch information
slouken committed Sep 21, 2009
1 parent b7beec2 commit 6660797
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/joystick/linux/SDL_sysjoystick.c
Expand Up @@ -1191,8 +1191,8 @@ void SDL_SYS_JoystickQuit(void)

for ( i=0; SDL_joylist[i].fname; ++i ) {
SDL_free(SDL_joylist[i].fname);
SDL_joylist[i].fname = NULL;
}
SDL_joylist[0].fname = NULL;
}

#endif /* SDL_JOYSTICK_LINUX */

0 comments on commit 6660797

Please sign in to comment.