summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonsta <[email protected]>2015-12-25 11:58:58 +0300
committermonsta <[email protected]>2015-12-25 11:58:58 +0300
commitfa1422db50c6b1c7bb5264aa94134cfc2b4da5be (patch)
tree7568831d0bb347f9f8a57254d43e2722545a9aa7
parent25f5476b07bbb9445387438eebc0e0ab987ceaa0 (diff)
downloadpluma-fa1422db50c6b1c7bb5264aa94134cfc2b4da5be.tar.bz2
pluma-fa1422db50c6b1c7bb5264aa94134cfc2b4da5be.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 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);
}