From fb2e76889fb0263f63a70974b8f33cbb767b7824 Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Thu, 25 Mar 2021 01:12:11 +0000 Subject: [PATCH] Fix a small memory leak in game_controller.cpp --- SourceX/controls/devices/game_controller.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SourceX/controls/devices/game_controller.cpp b/SourceX/controls/devices/game_controller.cpp index b46ac3017..cabbc64d9 100644 --- a/SourceX/controls/devices/game_controller.cpp +++ b/SourceX/controls/devices/game_controller.cpp @@ -166,7 +166,9 @@ void GameController::Add(int joystick_index) controllers_->push_back(result); const SDL_JoystickGUID guid = SDL_JoystickGetGUID(sdl_joystick); - SDL_Log("Opened game controller with mapping:\n%s", SDL_GameControllerMappingForGUID(guid)); + char *mapping = SDL_GameControllerMappingForGUID(guid); + SDL_Log("Opened game controller with mapping:\n%s", mapping); + SDL_free(mapping); } void GameController::Remove(SDL_JoystickID instance_id)