evolution-jescs r249 - in trunk: . calendar storage



Author: jedywang
Date: Wed Feb 27 08:20:32 2008
New Revision: 249
URL: http://svn.gnome.org/viewvc/evolution-jescs?rev=249&view=rev

Log:
2008-02-27  Wang Xin  <jedy wang sun com>

	Free memory returned by icalcomponent_as_ical_string.
	More info, please refer to #516408.



Modified:
   trunk/ChangeLog
   trunk/calendar/cal-backend-wcap-events.c
   trunk/calendar/cal-backend-wcap.c
   trunk/storage/sunone-invitation-list-model.c
   trunk/storage/sunone-invitation-list.c

Modified: trunk/calendar/cal-backend-wcap-events.c
==============================================================================
--- trunk/calendar/cal-backend-wcap-events.c	(original)
+++ trunk/calendar/cal-backend-wcap-events.c	Wed Feb 27 08:20:32 2008
@@ -698,7 +698,8 @@
 		if (prop != NULL)
 			icalcomponent_add_property (fb, prop);
 
-		*freebusy = g_list_append (*freebusy, g_strdup (icalcomponent_as_ical_string (fb)));
+		*freebusy = g_list_append (*freebusy,
+				icalcomponent_as_ical_string (fb));
 	}
 
 	icalcomponent_free (icalcomp);

Modified: trunk/calendar/cal-backend-wcap.c
==============================================================================
--- trunk/calendar/cal-backend-wcap.c	(original)
+++ trunk/calendar/cal-backend-wcap.c	Wed Feb 27 08:20:32 2008
@@ -1343,8 +1343,8 @@
 
 	g_hash_table_foreach (priv->instances, build_calendar, icalcomp);
 	buf = icalcomponent_as_ical_string (icalcomp);
-
 	result = gnome_vfs_write (handle, buf, strlen (buf) * sizeof (char), &out);
+	g_free (buf);
 	icalcomponent_free (icalcomp);
 	gnome_vfs_close (handle);
 	if (result != GNOME_VFS_OK) {
@@ -2045,7 +2045,7 @@
 			*users = g_list_prepend (*users, tmp);
 	}
 	g_object_unref (comp);
-	*modified_calobj = g_strdup (icalcomponent_as_ical_string (top_level));
+	*modified_calobj = icalcomponent_as_ical_string (top_level);
  cleanup:	
 	icalcomponent_free (top_level);
 	
@@ -2599,7 +2599,7 @@
 	if (!vtzcomp)
 		return GNOME_Evolution_Calendar_OtherError;
 
-	*object = g_strdup (icalcomponent_as_ical_string (vtzcomp));
+	*object = icalcomponent_as_ical_string (vtzcomp);
 	return GNOME_Evolution_Calendar_Success;
 }
 

Modified: trunk/storage/sunone-invitation-list-model.c
==============================================================================
--- trunk/storage/sunone-invitation-list-model.c	(original)
+++ trunk/storage/sunone-invitation-list-model.c	Wed Feb 27 08:20:32 2008
@@ -723,9 +723,13 @@
 		key = g_strconcat (priv->calid, ":calendar", NULL);
 		wcap = sunone_connection_get_wcap (cnc, key);
 		g_free (key);
-		if (wcap)
-			cal_backend_wcap_events_update_objects (E_CAL_BACKEND_SYNC (wcap), NULL,
-					icalcomponent_as_ical_string (clonecomp), CALOBJ_MOD_ALL, NULL, NULL);
+		if (wcap) {
+			char *string = icalcomponent_as_ical_string (clonecomp);
+
+			cal_backend_wcap_events_update_objects (E_CAL_BACKEND_SYNC (wcap),
+					NULL, string, CALOBJ_MOD_ALL, NULL, NULL);
+			g_free (string);
+		}
 		icalcomponent_free (clonecomp);
 	}
 }

Modified: trunk/storage/sunone-invitation-list.c
==============================================================================
--- trunk/storage/sunone-invitation-list.c	(original)
+++ trunk/storage/sunone-invitation-list.c	Wed Feb 27 08:20:32 2008
@@ -243,6 +243,7 @@
 	top_level = toplevel_with_zones (list, comp);
 	string = icalcomponent_as_ical_string (top_level);
 	set_data (BONOBO_WIDGET (priv->control), string);
+	g_free (string);
 	icalcomponent_free (top_level);
 }
 



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