mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-04 22:55:09 +08:00
Fixed two memory leaks if added game controller mapping has lower priority.
Found by buildbot.
This commit is contained in:
@@ -675,6 +675,9 @@ SDL_PrivateAddMappingForGUID(SDL_JoystickGUID jGUID, const char *mappingString,
|
|||||||
pControllerMapping->priority = priority;
|
pControllerMapping->priority = priority;
|
||||||
/* refresh open controllers */
|
/* refresh open controllers */
|
||||||
SDL_PrivateGameControllerRefreshMapping(pControllerMapping);
|
SDL_PrivateGameControllerRefreshMapping(pControllerMapping);
|
||||||
|
} else {
|
||||||
|
SDL_free(pchName);
|
||||||
|
SDL_free(pchMapping);
|
||||||
}
|
}
|
||||||
*existing = SDL_TRUE;
|
*existing = SDL_TRUE;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user