From f0151c785648b44850b46fa50336126c282fcc58 Mon Sep 17 00:00:00 2001 From: Samarjit Adhikari Date: Sun, 12 May 2013 08:27:36 -0400 Subject: Bug 697632 - [mail-to-task] Invalid unref of a CamelFolder e_mail_reader_get_folder() does not return a new CamelFolder reference, yet mail_to_event() was acting as though it does. This caused a crash after the function ran and Evolution tried to use the folder again. Truth be told, e_mail_reader_get_folder() really *should* return a new reference to ensure the CamelFolder is not finalized while it's in use. But we would need to rename the function to e_mail_reader_ref_folder() to reflect the change in semantics, and I suspect the function is used in a great many places. --- plugins/mail-to-task/mail-to-task.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/mail-to-task/mail-to-task.c b/plugins/mail-to-task/mail-to-task.c index 34473bcd03..0293701a0e 100644 --- a/plugins/mail-to-task/mail-to-task.c +++ b/plugins/mail-to-task/mail-to-task.c @@ -1130,7 +1130,6 @@ mail_to_event (ECalClientSourceType source_type, if (response == GTK_RESPONSE_NO) { em_utils_uids_free (uids); - g_object_unref (folder); return; } } @@ -1199,7 +1198,6 @@ mail_to_event (ECalClientSourceType source_type, e_notice (NULL, GTK_MESSAGE_ERROR, _("No writable calendar is available.")); em_utils_uids_free (uids); - g_object_unref (folder); if (error) g_error_free (error); goto exit; @@ -1215,7 +1213,7 @@ mail_to_event (ECalClientSourceType source_type, data = g_new0 (AsyncData, 1); data->source = g_object_ref (source); data->source_type = source_type; - data->folder = folder; + data->folder = g_object_ref (folder); data->uids = uids; data->with_attendees = with_attendees; -- cgit v1.2.3