diff --git a/desktop_version/src/KeyPoll.cpp b/desktop_version/src/KeyPoll.cpp index 60abc843..c6cdb4e5 100644 --- a/desktop_version/src/KeyPoll.cpp +++ b/desktop_version/src/KeyPoll.cpp @@ -141,7 +141,12 @@ void KeyPoll::Poll(void) else if ( evt.key.keysym.sym == SDLK_v && keymap[SDLK_LCTRL] ) { - keybuffer += SDL_GetClipboardText(); + char* text = SDL_GetClipboardText(); + if (text != NULL) + { + keybuffer += text; + SDL_free(text); + } } } break;