From 69a1e923a71ee881721e21b991de08b897f9e7b0 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 1 Jun 2009 21:27:44 +0200 Subject: Part of bug #574940 - Do not use freed memory in EMFolderView/Browser --- mail/em-folder-browser.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'mail') diff --git a/mail/em-folder-browser.c b/mail/em-folder-browser.c index 3c2d223307..50add07fb7 100644 --- a/mail/em-folder-browser.c +++ b/mail/em-folder-browser.c @@ -1939,8 +1939,12 @@ emfb_gui_folder_changed(CamelFolder *folder, gpointer dummy, EMFolderBrowser *em mi = camel_folder_get_message_info(emfb->view.folder, emfb->priv->select_uid); if (mi) { + /* because some sub-functions might free the pointer before it's done here */ + gchar *uid = g_strdup (emfb->priv->select_uid); + camel_folder_free_message_info(emfb->view.folder, mi); - em_folder_view_set_message(&emfb->view, emfb->priv->select_uid, FALSE); + em_folder_view_set_message (&emfb->view, uid, FALSE); + g_free (uid); g_free (emfb->priv->select_uid); emfb->priv->select_uid = NULL; } -- cgit