From fa1422db50c6b1c7bb5264aa94134cfc2b4da5be Mon Sep 17 00:00:00 2001 From: monsta Date: Fri, 25 Dec 2015 11:58:58 +0300 Subject: fix possible use-after-free during incremental search adapted from https://git.gnome.org/browse/gedit/commit/?id=f8508ca201e7d16fa5e18a6130f456fdd3fc0c99 --- pluma/pluma-view.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pluma/pluma-view.c b/pluma/pluma-view.c index 66ba62a5..4a0522e0 100644 --- a/pluma/pluma-view.c +++ b/pluma/pluma-view.c @@ -1627,12 +1627,11 @@ init_search_entry (PlumaView *view) guint old_find_flags = 0; gint sel_len = 0; - g_free (view->priv->old_search_text); - old_find_text = pluma_document_get_search_text (PLUMA_DOCUMENT (buffer), &old_find_flags); if (old_find_text != NULL) { + g_free (view->priv->old_search_text); view->priv->old_search_text = old_find_text; add_search_completion_entry (old_find_text); } -- cgit v1.2.1