[evolution-patches] Patches to fix bug 309079



Greetings all.

While working on fixing bug #274032 (PDA sync doesn't work on FC4), I
came across a couple of memory leaks in the evolution data server while
running gpilotd under valgrind.

The attached patches fix those two memory leaks, as well as providing a
changelog entry. They are also attached to
http://bugzilla.gnome.org/show_bug.cgi?id=309079 where I originally
reported this.

The first patch fixes the leak where we create a uid in
cal_object_created_cb and cal_add_timezone_cb in
calendar/libecal/e-cal.c, but then never free the uid.

The second patch fixes the leak where build_change_list in
calendar/libecal/e-cal-listener.c calls e_cal_component_new () to create
new components, but then never frees them.

//Mark

--- calendar/libecal/e-cal.c~	2005-06-26 02:30:34.000000000 -0400
+++ calendar/libecal/e-cal.c	2005-06-26 03:46:14.000000000 -0400
@@ -259,6 +259,7 @@
 	/* XXX more stuff here */
 	g_cond_free (op->cond);
 	g_mutex_free (op->mutex);
+	g_free (op->uid);
 	g_free (op);
 }
 
--- calendar/libecal/e-cal-listener.c~	2005-03-06 09:56:37.000000000 -0500
+++ calendar/libecal/e-cal-listener.c	2005-06-26 03:55:19.000000000 -0400
@@ -529,7 +529,10 @@
 	g_signal_emit (G_OBJECT (listener), signals[GET_CHANGES], 0, convert_status (status), changes);
 
 	for (l = changes; l; l = l->next)
+	{
+		g_object_unref (G_OBJECT (((ECalChange *)l->data)->comp));
 		g_free (l->data);
+	}
 	g_list_free (changes);
 }
 
--- ChangeLog~	2005-04-08 09:12:04.000000000 -0400
+++ ChangeLog	2005-06-27 10:48:10.000000000 -0400
@@ -1,3 +1,9 @@
+2005-06-27  Mark G. Adams <mark g adams sympatico ca>
+
+	* calendar/libecal/e-cal.c: fix leaking of uids
+	* calendar/libecal/e-cal-listener.c: fix leaking of e_cal components
+	on change notifications
+
 2005-04-07  JP Rosevear  <jpr novell com>
 
 	* configure.in: bump version, libtool numbers
@@ -954,7 +960,7 @@
 
 	* configure.in: bump version to 0.0.92.1.
 
-2004-04-21  Tomasz Kłoczko <kloczek pld org pl>
+2004-04-21  Tomasz K�oczko <kloczek pld org pl>
 
 	* acinclude.m4: minor fixes (added missing [] quotation).
 


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