Commit 15bcf58d779fca8da37a7c3e8562af9d2503bbea

Sam Lantinga 2022-08-01T08:14:40

Fixed memory leak in the Windows driver

diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c
index 9ff31d7..0f0402b 100644
--- a/src/video/windows/SDL_windowskeyboard.c
+++ b/src/video/windows/SDL_windowskeyboard.c
@@ -158,9 +158,16 @@ WIN_UpdateKeymap(SDL_bool send_event)
 void
 WIN_QuitKeyboard(_THIS)
 {
+    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
+
 #ifndef SDL_DISABLE_WINDOWS_IME
-    IME_Quit((SDL_VideoData *)_this->driverdata);
+    IME_Quit(data);
 #endif
+
+    if (data->ime_composition) {
+        SDL_free(data->ime_composition);
+        data->ime_composition = NULL;
+    }
 }
 
 void