Skip to content

Commit

Permalink
Fixed two memory leaks if added game controller mapping has lower pri…
Browse files Browse the repository at this point in the history
…ority.

Found by buildbot.
  • Loading branch information
philippwiesemann committed Nov 19, 2016
1 parent a49ac09 commit eb9cc03
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/joystick/SDL_gamecontroller.c
Expand Up @@ -675,6 +675,9 @@ SDL_PrivateAddMappingForGUID(SDL_JoystickGUID jGUID, const char *mappingString,
pControllerMapping->priority = priority;
/* refresh open controllers */
SDL_PrivateGameControllerRefreshMapping(pControllerMapping);
} else {
SDL_free(pchName);
SDL_free(pchMapping);
}
*existing = SDL_TRUE;
} else {
Expand Down

0 comments on commit eb9cc03

Please sign in to comment.