Commit 17406a3e authored by Sam Lantinga's avatar Sam Lantinga

Fixed potential double-free crash

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403555
parent 2bed25d8
...@@ -1210,9 +1210,11 @@ SDL_SYS_JoystickQuit(void) ...@@ -1210,9 +1210,11 @@ SDL_SYS_JoystickQuit(void)
int i; int i;
for (i = 0; SDL_joylist[i].fname; ++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 */ #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