# HG changeset patch # User Sam Lantinga # Date 1236318813 0 # Node ID 0ea7b6bb405431d62f4a08408b9bfb19946a31aa # Parent 1825768f1f721a3c8bc100ee6a107c96ce77f6a8 Fixed potential double-free crash diff -r 1825768f1f72 -r 0ea7b6bb4054 src/joystick/linux/SDL_sysjoystick.c --- a/src/joystick/linux/SDL_sysjoystick.c Fri Mar 06 05:48:52 2009 +0000 +++ b/src/joystick/linux/SDL_sysjoystick.c Fri Mar 06 05:53:33 2009 +0000 @@ -1210,9 +1210,11 @@ int i; for (i = 0; SDL_joylist[i].fname; ++i) { - SDL_free(SDL_joylist[i].fname); + if (SDL_joylist[i].fname) { + SDL_free(SDL_joylist[i].fname); + SDL_joylist[i].fname = NULL; + } } - SDL_joylist[0].fname = NULL; } #endif /* SDL_JOYSTICK_LINUX */