Commit 006aafabcf76545e3712529b28c8bcec862c4cc5

Sam Lantinga 2022-03-22T20:23:09

Fixed freeing a constant string (thanks @gnrlwart)

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/joystick/windows/SDL_windows_gaming_input.c b/src/joystick/windows/SDL_windows_gaming_input.c
index e9ff1da..a731dad 100644
--- a/src/joystick/windows/SDL_windows_gaming_input.c
+++ b/src/joystick/windows/SDL_windows_gaming_input.c
@@ -285,7 +285,7 @@ static HRESULT STDMETHODCALLTYPE IEventHandler_CRawGameControllerVtbl_InvokeAdde
             __x_ABI_CWindows_CGaming_CInput_CIRawGameController2_Release(controller2);
         }
         if (!name) {
-            name = "";
+            name = SDL_strdup("");
         }
 
         hr = __x_ABI_CWindows_CGaming_CInput_CIRawGameController_QueryInterface(controller, &IID_IGameController, (void **)&gamecontroller);