Ticket #1996: ViewContinueSearch segfault on empty search

Steps to reproduce:
1. F7,
2. set empty search string,
3. enter
4. n
5. enter
6. n

Fix issue: set view->last_search_string to NULL after call g_free()

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
Slava Zanko 2010-02-09 11:57:05 +02:00
parent a394ec47f1
commit f9b956b483
1 changed files with 2 additions and 0 deletions

View File

@ -110,6 +110,7 @@ mcview_continue_search_cmd (mcview_t * view)
if (!view->search) {
/* if not... then ask for an expression */
g_free(view->last_search_string);
view->last_search_string = NULL;
mcview_search (view);
} else {
view->search->search_type = view->search_type;
@ -124,6 +125,7 @@ mcview_continue_search_cmd (mcview_t * view)
} else {
/* if not... then ask for an expression */
g_free(view->last_search_string);
view->last_search_string = NULL;
mcview_search (view);
}
}