[evolution/kill-bonobo] Possible leak fix



commit 1c12da3c39cf36898cf336977a02578fe37d60b2
Author: Milan Crha <mcrha redhat com>
Date:   Fri Apr 24 20:41:00 2009 +0200

    Possible leak fix
    
    	** Part of fix for bug #571272
---
 calendar/ChangeLog         |    6 ++++++
 calendar/gui/e-cal-model.c |    8 ++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index f461af6..0885b50 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,5 +1,11 @@
 2009-04-24  Milan Crha  <mcrha redhat com>
 
+	** Part of fix for bug #571272
+
+	* gui/e-cal-model.c: (search_by_id_and_client):	Possible leak fix.
+
+2009-04-24  Milan Crha  <mcrha redhat com>
+
 	** Part of fix for bug #569652
 
 	* gui/calendar-component.c: (ensure_sources):
diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c
index 13d9d26..fd26779 100644
--- a/calendar/gui/e-cal-model.c
+++ b/calendar/gui/e-cal-model.c
@@ -1336,10 +1336,13 @@ search_by_id_and_client (ECalModelPrivate *priv, ECal *client, const ECalCompone
 		if (comp_data) {
 			const char *uid;
 			char *rid = NULL;
+			struct icaltimetype icalrid;
 			gboolean has_rid = (id->rid && *id->rid);
 
 			uid = icalcomponent_get_uid (comp_data->icalcomp);
-			rid = icaltime_as_ical_string_r (icalcomponent_get_recurrenceid (comp_data->icalcomp));
+			icalrid = icalcomponent_get_recurrenceid (comp_data->icalcomp);
+			if (!icaltime_is_null_time (icalrid))
+				rid = icaltime_as_ical_string_r (icalrid);
 
 			if (uid && *uid) {
 				if ((!client || comp_data->client == client) && !strcmp (id->uid, uid)) {
@@ -1352,8 +1355,9 @@ search_by_id_and_client (ECalModelPrivate *priv, ECal *client, const ECalCompone
 					g_free (rid);
 					return comp_data;
 				}
-			g_free (rid);
 			}
+
+			g_free (rid);
 		}
 	}
 



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