From bccd23f4bf9435a35c625ae0ae1fdfe888eae213 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Fri, 1 Apr 2022 21:55:03 +0800 Subject: [PATCH] Fix memory leak when handling Linux primary clipboard --- platform/x11/os_x11.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 4dc81a7d7cf..bca808ca1f2 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -2229,7 +2229,7 @@ Atom OS_X11::_process_selection_request_target(Atom p_target, Window p_requestor // is the owner during a selection request. CharString clip; static const char *target_type = "PRIMARY"; - if (p_selection != None && String(XGetAtomName(x11_display, p_selection)) == target_type) { + if (p_selection != None && get_atom_name(x11_display, p_selection) == target_type) { clip = OS::get_clipboard_primary().utf8(); } else { clip = OS::get_clipboard().utf8();