Skip to content

Commit

Permalink
Plug a memory leak
Browse files Browse the repository at this point in the history
Thanks to Pavel Roschin for spotting it.
  • Loading branch information
b4n committed Sep 24, 2013
1 parent af3421e commit e4eacef
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/keybindings.c
Expand Up @@ -1453,7 +1453,7 @@ static gboolean cb_func_search_action(guint key_id)
on_find_document_usage1_activate(NULL, NULL); break;
case GEANY_KEYS_SEARCH_MARKALL:
{
gchar *text = get_current_word_or_sel(doc, TRUE);
gchar *text = NULL;
gint pos = sci_get_current_position(sci);

/* clear existing search indicators instead if next to cursor */
Expand All @@ -1462,6 +1462,8 @@ static gboolean cb_func_search_action(guint key_id)
scintilla_send_message(sci, SCI_INDICATORVALUEAT,
GEANY_INDICATOR_SEARCH, MAX(pos - 1, 0)))
text = NULL;
else
text = get_current_word_or_sel(doc, TRUE);

if (sci_has_selection(sci))
search_mark_all(doc, text, SCFIND_MATCHCASE);
Expand Down

0 comments on commit e4eacef

Please sign in to comment.