evolution-data-server r8701 - in branches/gnome-2-22: addressbook addressbook/backends/groupwise addressbook/libedata-book calendar calendar/backends/groupwise calendar/libecal servers/groupwise



Author: abharath
Date: Tue Apr 29 13:40:39 2008
New Revision: 8701
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=8701&view=rev

Log:
Committing on behalf of Chenthill Palanisamy  <pchenthill novell com>

2008-04-29  Chenthill Palanisamy  <pchenthill novell com>

        ** Fixes part of #350143 (bnc)
           Severe memory leak in evolution-data-server


Modified:
   branches/gnome-2-22/addressbook/ChangeLog
   branches/gnome-2-22/addressbook/backends/groupwise/e-book-backend-groupwise.c
   branches/gnome-2-22/addressbook/libedata-book/e-book-backend-db-cache.c
   branches/gnome-2-22/calendar/ChangeLog
   branches/gnome-2-22/calendar/backends/groupwise/e-cal-backend-groupwise-utils.c
   branches/gnome-2-22/calendar/backends/groupwise/e-cal-backend-groupwise.c
   branches/gnome-2-22/calendar/libecal/e-cal-component.c
   branches/gnome-2-22/servers/groupwise/ChangeLog
   branches/gnome-2-22/servers/groupwise/e-gw-container.c
   branches/gnome-2-22/servers/groupwise/e-gw-item.c

Modified: branches/gnome-2-22/addressbook/backends/groupwise/e-book-backend-groupwise.c
==============================================================================
--- branches/gnome-2-22/addressbook/backends/groupwise/e-book-backend-groupwise.c	(original)
+++ branches/gnome-2-22/addressbook/backends/groupwise/e-book-backend-groupwise.c	Tue Apr 29 13:40:39 2008
@@ -2241,6 +2241,9 @@
 			view = "name email";
 
 		if (search_string) {
+			if (filter)
+				g_object_unref (filter);
+
 			/* groupwise server supports only name, rebuild the filter */
 			filter = e_gw_filter_new ();
 			e_gw_filter_add_filter_component (filter, E_GW_FILTER_OP_BEGINS,
@@ -2297,6 +2300,8 @@
 					printf("reading contacts from cache took %ld.%03ld seconds\n",
 						diff/1000,diff%1000);
 				}
+				if (filter)
+					g_object_unref (filter);
 				return NULL;
 			}
 			else {
@@ -2337,9 +2342,12 @@
 				if (temp_list)
 					g_list_free (temp_list);
 				bonobo_object_unref (book_view);
-	
+				
+				if (filter)	
+					g_object_unref (filter);
+
 				return NULL;
-			}
+			} 
 		
 			/* no summary information found, read from server */
 			if (enable_debug)
@@ -2362,6 +2370,8 @@
 		if (status != E_GW_CONNECTION_STATUS_OK) {
 			e_data_book_view_notify_complete (book_view, GNOME_Evolution_Addressbook_OtherError);
 			bonobo_object_unref (book_view);
+			if (filter)
+				g_object_unref (filter);
 			return NULL;
 		}
 

Modified: branches/gnome-2-22/addressbook/libedata-book/e-book-backend-db-cache.c
==============================================================================
--- branches/gnome-2-22/addressbook/libedata-book/e-book-backend-db-cache.c	(original)
+++ branches/gnome-2-22/addressbook/libedata-book/e-book-backend-db-cache.c	Tue Apr 29 13:40:39 2008
@@ -287,6 +287,8 @@
 	db_error = db->cursor (db, NULL, &dbc, 0);
 	if (db_error != 0) {
 		g_warning ("db->cursor failed with %d", db_error);
+		if (sexp)
+			g_object_unref (sexp);
 		return NULL;
 	}
 

Modified: branches/gnome-2-22/calendar/backends/groupwise/e-cal-backend-groupwise-utils.c
==============================================================================
--- branches/gnome-2-22/calendar/backends/groupwise/e-cal-backend-groupwise-utils.c	(original)
+++ branches/gnome-2-22/calendar/backends/groupwise/e-cal-backend-groupwise-utils.c	Tue Apr 29 13:40:39 2008
@@ -1071,7 +1071,6 @@
 			e_cal_component_set_dtstamp (comp, &itt_utc);
 		}
 	}
-	g_free (t);
 
 	/* categories */
 	category_ids = e_gw_item_get_categories (item);
@@ -1092,7 +1091,6 @@
 	is_allday = e_gw_item_get_is_allday_event (item);
 
 	/* start date */
-	/* should i duplicate here ? */
 	t = e_gw_item_get_start_date (item);
 	if (t) {
 		itt_utc = icaltime_from_string (t);
@@ -1145,8 +1143,6 @@
 		}
 	}
 
-	g_free (t);
-
 	/* classification */
 	description = e_gw_item_get_classification (item);
 	if (description) {
@@ -1282,6 +1278,7 @@
 			trigger.u.rel_duration = icaldurationtype_from_int (alarm_duration);
 			e_cal_component_alarm_set_trigger (alarm, trigger);
 			e_cal_component_add_alarm (comp, alarm);
+			e_cal_component_alarm_free (alarm);
 
 		} else
 			set_default_alarms (comp);
@@ -1678,7 +1675,7 @@
         SoupSoapResponse *response;
         EGwConnectionStatus status;
         SoupSoapParameter *param, *subparam, *param_outstanding;
-        const char *session;
+        char *session;
 	char *outstanding = NULL;
 	gboolean resend_request = TRUE;
 	int request_iteration = 0;
@@ -1706,6 +1703,7 @@
 	response = e_gw_connection_send_message (cnc, msg);
 	if (!response) {
 		g_object_unref (msg);
+		g_free (session);
 		return E_GW_CONNECTION_STATUS_NO_RESPONSE;
 	}
 
@@ -1713,6 +1711,7 @@
         if (status != E_GW_CONNECTION_STATUS_OK) {
                 g_object_unref (msg);
                 g_object_unref (response);
+		g_free (session);
                 return status;
         }
 
@@ -1720,6 +1719,7 @@
         if (!param) {
                 g_object_unref (response);
                 g_object_unref (msg);
+		g_free (session);
                 return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
         }
 
@@ -1860,7 +1860,10 @@
 	} /* end of while loop */
 
         /* closeFreeBusySession*/
-        return close_freebusy_session (cnc, session);
+	status = close_freebusy_session (cnc, session);
+	g_free (session);
+
+        return status;
 }
 
 #define SET_DELTA(fieldname) G_STMT_START{                                                                \

Modified: branches/gnome-2-22/calendar/backends/groupwise/e-cal-backend-groupwise.c
==============================================================================
--- branches/gnome-2-22/calendar/backends/groupwise/e-cal-backend-groupwise.c	(original)
+++ branches/gnome-2-22/calendar/backends/groupwise/e-cal-backend-groupwise.c	Tue Apr 29 13:40:39 2008
@@ -1377,6 +1377,9 @@
 				     mangled_uri,
 				     NULL);
 	g_free (mangled_uri);
+	if (priv->local_attachments_store)
+		g_free (priv->local_attachments_store);
+
 	priv->local_attachments_store =
 		g_filename_to_uri (filename, NULL, NULL);
 	g_free (filename);

Modified: branches/gnome-2-22/calendar/libecal/e-cal-component.c
==============================================================================
--- branches/gnome-2-22/calendar/libecal/e-cal-component.c	(original)
+++ branches/gnome-2-22/calendar/libecal/e-cal-component.c	Tue Apr 29 13:40:39 2008
@@ -1546,6 +1546,7 @@
 
 			icalcomponent_remove_property (icalcomp, attachment->prop);
 			icalproperty_free (attachment->prop);
+			icalattach_unref (attachment->attach);
 			g_free (attachment);
 		}
 

Modified: branches/gnome-2-22/servers/groupwise/e-gw-container.c
==============================================================================
--- branches/gnome-2-22/servers/groupwise/e-gw-container.c	(original)
+++ branches/gnome-2-22/servers/groupwise/e-gw-container.c	Tue Apr 29 13:40:39 2008
@@ -60,7 +60,7 @@
 {
 	if(user){
 		g_free(user->email);
-		user->email = NULL;
+		g_free (user);
 	}
 	g_free (user);
 	return ;

Modified: branches/gnome-2-22/servers/groupwise/e-gw-item.c
==============================================================================
--- branches/gnome-2-22/servers/groupwise/e-gw-item.c	(original)
+++ branches/gnome-2-22/servers/groupwise/e-gw-item.c	Tue Apr 29 13:40:39 2008
@@ -456,6 +456,21 @@
 			priv->end_date = NULL;
 		}
 
+		if (priv->delivered_date) {
+			g_free (priv->delivered_date);
+			priv->delivered_date = NULL;
+		}
+
+		if (priv->start_date) {
+			g_free (priv->start_date);
+			priv->start_date = NULL;
+		}
+
+		if (priv->creation_date) {
+			g_free (priv->creation_date);
+			priv->creation_date = NULL;
+                }
+
 		free_changes (priv->additions);
 		free_changes (priv->deletions);
 		free_changes (priv->updates);
@@ -528,7 +543,7 @@
 	priv->attach_list = NULL ;
 	priv->simple_fields = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_free);
 	priv->full_name = g_new0(FullName, 1);
-	priv->addresses = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, free_postal_address);
+	priv->addresses = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, free_postal_address);
 	priv->additions = g_hash_table_new(g_str_hash, g_str_equal);
 	priv->updates =   g_hash_table_new (g_str_hash, g_str_equal);
 	priv->deletions = g_hash_table_new (g_str_hash, g_str_equal);
@@ -1396,7 +1411,7 @@
 	if (subparam) {
 		address = g_new0 (PostalAddress, 1);
 		set_postal_address_from_soap_parameter (address, subparam);
-		g_hash_table_insert (item->priv->addresses, "Office", address);
+		g_hash_table_insert (item->priv->addresses, g_strdup ("Office"), address);
 
 	}
 
@@ -1974,8 +1989,11 @@
 					attach->contentType = soup_soap_parameter_get_string_value (temp) ;
 
 				temp = soup_soap_parameter_get_first_child_by_name (attachment_param, "size") ;
-				if (temp)
-					attach->size = atoi (soup_soap_parameter_get_string_value (temp)) ;
+				if (temp) {
+					value = soup_soap_parameter_get_string_value (temp);
+					attach->size = atoi (value);
+					g_free (value);
+				}
 
 				temp = soup_soap_parameter_get_first_child_by_name (attachment_param, "date") ;
 				if (temp)



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