Index: servers/groupwise/ChangeLog
===================================================================
--- servers/groupwise/ChangeLog	(revision 8667)
+++ servers/groupwise/ChangeLog	(working copy)
@@ -1,3 +1,11 @@
+2008-04-21  Milan Crha  <mcrha@redhat.com>
+
+	** Partial fix for bug #510949
+
+	* soup-soap-message.c: (soup_soap_message_persist):
+	* e-gw-item.c: (e_gw_item_dispose), (e_gw_item_set_organizer),
+	(e_gw_item_new_from_soap_parameter): Memory leak fix.
+
 2008-03-26  Stanislav Brabec  <sbrabec@suse.cz>
 
 	** Fix for bug #522389
Index: servers/groupwise/soup-soap-message.c
===================================================================
--- servers/groupwise/soup-soap-message.c	(revision 8667)
+++ servers/groupwise/soup-soap-message.c	(working copy)
@@ -744,7 +744,9 @@ soup_soap_message_persist (SoupSoapMessa
 
 	/* serialize to SoupMessage class */
 	soup_message_set_request (SOUP_MESSAGE (msg), "text/xml",
-				  SOUP_MEMORY_TAKE, (char *)body, len);
+				  SOUP_MEMORY_TAKE, (const char *)body, len);
+
+	xmlFree (body);
 }
 
 /**
Index: servers/groupwise/e-gw-item.c
===================================================================
--- servers/groupwise/e-gw-item.c	(revision 8667)
+++ servers/groupwise/e-gw-item.c	(working copy)
@@ -372,6 +372,7 @@ e_gw_item_dispose (GObject *object)
 		if (priv->organizer) {
 			g_free (priv->organizer->display_name);
 			g_free (priv->organizer->email);
+			g_free (priv->organizer);
 			priv->organizer = NULL;
 		}
 
@@ -1963,8 +1964,13 @@ e_gw_item_new_from_soap_parameter (const
 					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) {
+					char *buf = soup_soap_parameter_get_string_value (temp);
+
+					attach->size = atoi (buf);
+
+					g_free (buf);
+				}
 
 				temp = soup_soap_parameter_get_first_child_by_name (attachment_param, "date") ;
 				if (temp)
@@ -2443,7 +2449,11 @@ void
 e_gw_item_set_organizer (EGwItem  *item, EGwItemOrganizer *organizer)
 {
 	/* free organizer */
-	g_free (item->priv->organizer);
+	if (item->priv->organizer) {
+		g_free (item->priv->organizer->display_name);
+		g_free (item->priv->organizer->email);
+		g_free (item->priv->organizer);
+	}
 	item->priv->organizer = organizer;
 }
 
Index: calendar/ChangeLog
===================================================================
--- calendar/ChangeLog	(revision 8667)
+++ calendar/ChangeLog	(working copy)
@@ -1,3 +1,13 @@
+2008-04-21  Milan Crha  <mcrha@redhat.com>
+
+	** Partial fix for bug #510949
+
+	* backends/groupwise/e-cal-backend-groupwise.c: (get_deltas),
+	(e_cal_backend_groupwise_refresh_calendar):
+	Memory leak fix and compiler warnings fix.
+	* libecal/e-cal-component.c: (e_cal_component_get_recurid_as_string):
+	Possible memory leak fix.
+
 2008-04-17  Milan Crha  <mcrha@redhat.com>
 
 	** Part of fix for bug #526741
Index: calendar/backends/groupwise/e-cal-backend-groupwise.c
===================================================================
--- calendar/backends/groupwise/e-cal-backend-groupwise.c	(revision 8667)
+++ calendar/backends/groupwise/e-cal-backend-groupwise.c	(working copy)
@@ -537,7 +537,7 @@ get_deltas (gpointer handle)
 		const char *recur_key;
 
 		if (calid->recur_key && calid->ical_id) {
-			const char *rid = NULL;
+			char *rid = NULL;
 			char *temp = NULL;
 			icaltimetype tt = icaltime_from_string (calid->ical_id);
 			if (!tt.is_date) {
@@ -628,6 +628,7 @@ get_deltas (gpointer handle)
 
 	e_file_cache_thaw_changes (E_FILE_CACHE (cache));
 
+	g_ptr_array_foreach (uid_array, (GFunc) g_free, NULL);
 	g_ptr_array_free (uid_array, TRUE);
 
 	if (item_list) {
@@ -736,7 +737,7 @@ start_fetch_deltas (gpointer data)
 	return FALSE;
 }
 
-
+#if 0
 /* TODO call it when a user presses SEND/RECEIVE or refresh*/
 static void
 e_cal_backend_groupwise_refresh_calendar (ECalBackendGroupwise *cbgw)
@@ -755,6 +756,7 @@ e_cal_backend_groupwise_refresh_calendar
 	if (!delta_started)
 		g_cond_signal (priv->dlock->cond);
 }
+#endif
 
 static char*
 form_uri (ESource *source)
Index: calendar/libecal/e-cal-component.c
===================================================================
--- calendar/libecal/e-cal-component.c	(revision 8667)
+++ calendar/libecal/e-cal-component.c	(working copy)
@@ -3571,8 +3571,11 @@ e_cal_component_get_recurid_as_string (E
 		return NULL;
 
         e_cal_component_get_recurid (comp, &range);
-        if (!range.datetime.value)
+        if (!range.datetime.value) {
+		e_cal_component_free_range (&range);
                 return g_strdup ("0");
+	}
+
         tt = *range.datetime.value;
         e_cal_component_free_range (&range);
 
