Navigation Menu

Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed potential double-free crash
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Mar 6, 2009
1 parent e81a650 commit b87eac4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/joystick/linux/SDL_sysjoystick.c
Expand Up @@ -1210,9 +1210,11 @@ SDL_SYS_JoystickQuit(void)
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 */
Expand Down

0 comments on commit b87eac4

Please sign in to comment.