Skip to content

Commit

Permalink
SDL: Plug a memory leak in OSystem_SDL::getTextFromClipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
bgK committed Sep 13, 2016
1 parent 10fd504 commit 9e502bf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions backends/platform/sdl/sdl.cpp
Expand Up @@ -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
Expand Down

0 comments on commit 9e502bf

Please sign in to comment.