From f9b956b483cca08c637102198072b9d6518966f7 Mon Sep 17 00:00:00 2001 From: Slava Zanko Date: Tue, 9 Feb 2010 11:57:05 +0200 Subject: [PATCH] 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 --- src/viewer/actions_cmd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/viewer/actions_cmd.c b/src/viewer/actions_cmd.c index c8ce32a22..9b83d3faa 100644 --- a/src/viewer/actions_cmd.c +++ b/src/viewer/actions_cmd.c @@ -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); } }