Fixed two memory leaks if added game controller mapping has lower priority.

Found by buildbot.
Philipp Wiesemann 2016-11-19 23:27:37 +01:00
parent a49ac09c02
commit eb9cc03068
1 changed files with 3 additions and 0 deletions

View File

@ -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 {