Fixed two memory leaks if added game controller mapping has lower priority.
authorPhilipp Wiesemann
Sat, 19 Nov 2016 23:27:37 +0100
changeset 10632e5f5afc9f3fb
parent 10631 29871de88287
child 10633 2fa3dd0d12f6
Fixed two memory leaks if added game controller mapping has lower priority.

Found by buildbot.
src/joystick/SDL_gamecontroller.c
     1.1 --- a/src/joystick/SDL_gamecontroller.c	Fri Nov 18 00:06:09 2016 +0100
     1.2 +++ b/src/joystick/SDL_gamecontroller.c	Sat Nov 19 23:27:37 2016 +0100
     1.3 @@ -675,6 +675,9 @@
     1.4              pControllerMapping->priority = priority;
     1.5              /* refresh open controllers */
     1.6              SDL_PrivateGameControllerRefreshMapping(pControllerMapping);
     1.7 +        } else {
     1.8 +            SDL_free(pchName);
     1.9 +            SDL_free(pchMapping);
    1.10          }
    1.11          *existing = SDL_TRUE;
    1.12      } else {