[Evolution-hackers] Possible bug in GW Camel provider



Hi,

After having thought about my previous mail about weird code in the GW
Camel provider, I have come to believe that it is actually a memory leak
and a possible race.

The issues are in "camel-groupwise-folder.c:gw_update_cache()". 

Please look at:

############### snip ###############
		mi = (CamelGroupwiseMessageInfo *)camel_folder_summary_uid (folder->summary, id);
		if (mi) {
			exists = TRUE;
			camel_message_info_free (&mi->info);
		}

		if (!exists) {

			<snip>

			mi = camel_message_info_new (folder->summary); 
			if (mi->info.content == NULL) {
				mi->info.content = camel_folder_summary_content_info_new (folder->summary);
				mi->info.content->type = camel_content_type_new ("multipart", "mixed");
			}
		}

		<snip>

		org = e_gw_item_get_organizer (item); 
		if (org) {
			g_string_append_printf (str, "%s <%s>",org->display_name, org->email);
			mi->info.from = camel_pstring_strdup (str->str);
		}
############### snip ###############

Problems seems to arise if "exists" is TRUE.

Issue 1) pstrings, such as "mi->info.from", are being overwritten
without being released. 

Issue 2) mi is being unref-ed but subsequently used. mi could vanish
while in use if another thread unrefs it once more.

Please comment.

Best regards,
  jules





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]