From 5cccff75fba861f6d6b06079949fcb458a4f7dae Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Wed, 28 Jul 2010 11:43:15 +0400 Subject: [PATCH] Ticket #2299: history can be shown incorrectly due to access to the invalid pointer. Signed-off-by: Andrew Borodin --- src/widget.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/widget.c b/src/widget.c index 280575ae8..437c3ad88 100644 --- a/src/widget.c +++ b/src/widget.c @@ -1492,12 +1492,12 @@ show_hist (GList ** history, Widget * widget) entry->text = NULL; } - destroy_dlg (query_dlg); - /* restore history direction */ if (query_dlg->y < widget->y) z = g_list_reverse (z); + destroy_dlg (query_dlg); + g_list_foreach (*history, (GFunc) g_free, NULL); g_list_free (*history); *history = g_list_last (z);