File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -1984,7 +1984,7 @@ const char *SDL_GameControllerPathForIndex(int joystick_index)
19841984SDL_GameControllerType SDL_GameControllerTypeForIndex (int joystick_index )
19851985{
19861986 SDL_JoystickGUID joystick_guid = SDL_JoystickGetDeviceGUID (joystick_index );
1987- const char * mapping = SDL_GameControllerMappingForGUID (joystick_guid );
1987+ char * mapping = SDL_GameControllerMappingForGUID (joystick_guid );
19881988 char * type_string , * comma ;
19891989 SDL_GameControllerType type ;
19901990 if (mapping ) {
@@ -1999,8 +1999,10 @@ SDL_GameControllerType SDL_GameControllerTypeForIndex(int joystick_index)
19991999 } else {
20002000 type = SDL_GetGameControllerTypeFromString (type_string );
20012001 }
2002+ SDL_free (mapping );
20022003 return type ;
20032004 }
2005+ SDL_free (mapping );
20042006 }
20052007 return SDL_GetJoystickGameControllerTypeFromGUID (joystick_guid , SDL_JoystickNameForIndex (joystick_index ));
20062008}
You can’t perform that action at this time.
0 commit comments