[evolution-kolab/ek-wip-porting] ECalBackendKolab: free() data conditionally at end of start_view()



commit e744b6d6b965d7cc2f4725dd7f5932233b29d1a1
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Mon Mar 19 20:59:24 2012 +0100

    ECalBackendKolab: free() data conditionally at end of start_view()

 src/calendar/e-cal-backend-kolab.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/calendar/e-cal-backend-kolab.c b/src/calendar/e-cal-backend-kolab.c
index e14eec6..808b968 100644
--- a/src/calendar/e-cal-backend-kolab.c
+++ b/src/calendar/e-cal-backend-kolab.c
@@ -1808,10 +1808,14 @@ e_cal_backend_kolab_start_view (ECalBackend *backend,
 	e_data_cal_view_notify_objects_added (view,
 	                                      iCal_objects);
  exit:
-	g_slist_foreach (iCal_objects, (GFunc) g_free, NULL);
-	g_slist_free (iCal_objects);
-	g_free (sourcename);
-	kolab_util_glib_glist_free (uid_list);
+	if (iCal_objects != NULL) {
+		g_slist_foreach (iCal_objects, (GFunc) g_free, NULL);
+		g_slist_free (iCal_objects);
+	}
+	if (sourcename != NULL)
+		g_free (sourcename);
+	if (uid_list != NULL)
+		kolab_util_glib_glist_free (uid_list);
 
 	if (tmp_err != NULL) {
 		kolab_util_calendar_err_to_edb_err (&view_err, tmp_err, __func__, __LINE__);



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