[evolution-patches] Exchange connector: fix for 74029



Hi,

e-source was being accessed after the unref.

Please review,
Sushma.
Index: storage/exchange-config-listener.c
===================================================================
RCS file: /cvs/gnome/evolution-exchange/storage/exchange-config-listener.c,v
retrieving revision 1.16
diff -u -p -r1.16 exchange-config-listener.c
--- storage/exchange-config-listener.c	28 Feb 2005 14:57:27 -0000	1.16
+++ storage/exchange-config-listener.c	24 Mar 2005 05:40:27 -0000
@@ -226,7 +226,7 @@ add_esource (ExchangeAccount *account, 
 	     const char *physical_uri,
 	     ESourceList **source_list)
 {
-	ESource *source;
+	ESource *source = NULL;
 	ESourceGroup *source_group;
 	char *relative_uri = NULL;
 	GSList *ids, *temp_ids;
@@ -270,7 +270,6 @@ add_esource (ExchangeAccount *account, 
 
 		e_source_group_add_source (source_group, source, -1);
 
-		g_object_unref (source);
 		g_object_unref (source_group);
 	}
 	else {
@@ -296,10 +295,9 @@ add_esource (ExchangeAccount *account, 
 					e_source_set_property (source, "offline_sync", "1");
 			}
 		}
-		g_object_unref (source);
 	}
 
-	if (!is_contacts_folder) {
+	if (source && !is_contacts_folder) {
 
 		if (folder_type == EXCHANGE_CALENDAR_FOLDER) {
 			ids = gconf_client_get_list (client,
@@ -335,6 +333,8 @@ add_esource (ExchangeAccount *account, 
 
 	if (relative_uri)
 		g_free (relative_uri);
+	if (source)
+		g_object_unref (source);
 	g_object_unref (client);
 }
 


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