test: Fix memory leak in testclipboard
Build (All) / Create test plan (push) Canceled after 0s
Build (All) / level1 (push) Canceled after 0s
Build (All) / level2 (push) Canceled after 0s

(cherry picked from commit d63137082a)
This commit is contained in:
Frank Praznik
2026-07-21 14:39:18 -04:00
parent dcea23748a
commit 13f58a7608
+5 -1
View File
@@ -130,7 +130,11 @@ static float PrintClipboardText(float x, float y, const char *mime_type)
static float PrintPrimarySelectionText(float x, float y)
{
if (SDL_HasPrimarySelectionText()) {
SDL_RenderDebugText(renderer, x, y, SDL_GetPrimarySelectionText());
char *text = SDL_GetPrimarySelectionText();
if (text) {
SDL_RenderDebugText(renderer, x, y, text);
SDL_free(text);
}
return SDL_DEBUG_TEXT_FONT_CHARACTER_SIZE + 2.0f;
}
return 0.0f;