summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonsta <[email protected]>2015-12-25 11:58:58 +0300
committermonsta <[email protected]>2016-02-10 17:44:01 +0300
commitd5e14f93693ba01a41f3ea8bc1f70bafcd89d62a (patch)
treed0f27986c323c9332923e517cadce795013ccc48
parent234d31adff2a88de5adc1e68a3bfb9d0904bf70c (diff)
downloadpluma-d5e14f93693ba01a41f3ea8bc1f70bafcd89d62a.tar.bz2
pluma-d5e14f93693ba01a41f3ea8bc1f70bafcd89d62a.tar.xz
fix possible use-after-free during incremental search
adapted from https://git.gnome.org/browse/gedit/commit/?id=f8508ca201e7d16fa5e18a6130f456fdd3fc0c99
-rw-r--r--pluma/pluma-view.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/pluma/pluma-view.c b/pluma/pluma-view.c
index a9a1d54a..5d393a75 100644
--- a/pluma/pluma-view.c
+++ b/pluma/pluma-view.c
@@ -1620,12 +1620,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);
}