From fdfcacf1db70df6dfe214838c65f5f6e329d27ee Mon Sep 17 00:00:00 2001 From: Sebastian Keller Date: Mon, 8 Jun 2020 00:42:00 +0200 Subject: [PATCH] st/entry: Fix leak when copying or cutting text using shortcuts clutter_text_get_selection() creates a copy of the selected text which gets passed to st_clipboard_set_text() which creates its own copy. The copy returned by clutter_text_get_selection() however never got free'd. https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1306 --- src/st/st-entry.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/st/st-entry.c b/src/st/st-entry.c index c946ca0f9..10dfe1dd1 100644 --- a/src/st/st-entry.c +++ b/src/st/st-entry.c @@ -678,6 +678,8 @@ st_entry_key_press_event (ClutterActor *actor, ST_CLIPBOARD_TYPE_CLIPBOARD, text); + g_free (text); + return TRUE; } @@ -704,6 +706,8 @@ st_entry_key_press_event (ClutterActor *actor, clutter_text_delete_selection ((ClutterText *) priv->entry); } + g_free (text); + return TRUE; }