Ticket #2299: history can be shown incorrectly due to access to the invalid pointer.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2010-07-28 11:43:15 +04:00
parent 44459c19f6
commit 5cccff75fb

View File

@ -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);