diff options
-rw-r--r-- | backends/platform/sdl/sdl.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index 18f2a49bdd..a175c530ee 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -477,8 +477,9 @@ Common::String OSystem_SDL::getTextFromClipboard() { #if SDL_VERSION_ATLEAST(2, 0, 0) char *text = SDL_GetClipboardText(); - if (text == nullptr) return ""; - return text; + Common::String strText = text; + SDL_free(text); + return strText; #else return ""; #endif |