aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorChenthill Palanisamy <pchenthill@novell.com>2008-02-25 02:34:05 +0800
committerChenthill Palanisamy <pchen@src.gnome.org>2008-02-25 02:34:05 +0800
commitd29b2af2244f1787c85937dc17e4fe0c7eaa807b (patch)
treeb3dce940809ddb7eccc1f21f4c551fc4b8f78d91 /calendar
parentb29522c36964307da284764c2be47d227af80600 (diff)
downloadgsoc2013-evolution-d29b2af2244f1787c85937dc17e4fe0c7eaa807b.tar
gsoc2013-evolution-d29b2af2244f1787c85937dc17e4fe0c7eaa807b.tar.gz
gsoc2013-evolution-d29b2af2244f1787c85937dc17e4fe0c7eaa807b.tar.bz2
gsoc2013-evolution-d29b2af2244f1787c85937dc17e4fe0c7eaa807b.tar.lz
gsoc2013-evolution-d29b2af2244f1787c85937dc17e4fe0c7eaa807b.tar.xz
gsoc2013-evolution-d29b2af2244f1787c85937dc17e4fe0c7eaa807b.tar.zst
gsoc2013-evolution-d29b2af2244f1787c85937dc17e4fe0c7eaa807b.zip
Fixes#516408
2008-02-24 Chenthill Palanisamy <pchenthill@novell.com> Fixes#516408 * gui/dialogs/e-send-options-utils.c (e_sendoptions_utils_fill_component): * gui/e-cal-model.c (search_by_id_and_client): * gui/e-calendar-table.c (copy_row_cb), (e_calendar_table_copy_clipboard): * gui/e-calendar-view.c (e_calendar_view_copy_clipboard), (icalcomp_contains_category): * gui/e-day-view.c (model_rows_deleted_cb), (e_day_view_find_event_from_uid), (e_day_view_reshape_day_events), (e_day_view_on_drag_data_get): * gui/e-itip-control.c (update_item): * gui/e-memo-table.c (copy_row_cb), * (e_memo_table_copy_clipboard): * gui/e-memos.c (obtain_list_of_components): * gui/e-tasks.c (obtain_list_of_components): * gui/e-week-view.c (model_rows_deleted_cb), (e_week_view_reshape_events), (e_week_view_find_event_from_uid): * gui/gnome-cal.c (gnome_calendar_purge): * gui/itip-utils.c (comp_limit_attendees), (itip_send_comp), (reply_to_calendar_comp), (itip_publish_comp): Free the memory returned by libical svn path=/trunk/; revision=35081
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog25
-rw-r--r--calendar/gui/dialogs/e-send-options-utils.c7
-rw-r--r--calendar/gui/e-cal-model.c9
-rw-r--r--calendar/gui/e-calendar-table.c2
-rw-r--r--calendar/gui/e-calendar-view.c5
-rw-r--r--calendar/gui/e-day-view.c19
-rw-r--r--calendar/gui/e-itip-control.c5
-rw-r--r--calendar/gui/e-memo-table.c2
-rw-r--r--calendar/gui/e-memos.c1
-rw-r--r--calendar/gui/e-tasks.c1
-rw-r--r--calendar/gui/e-week-view.c13
-rw-r--r--calendar/gui/gnome-cal.c3
-rw-r--r--calendar/gui/itip-utils.c17
13 files changed, 90 insertions, 19 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 9b5796052c..548bb043bf 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,28 @@
+2008-02-24 Chenthill Palanisamy <pchenthill@novell.com>
+
+ Fixes#516408
+ * gui/dialogs/e-send-options-utils.c
+ (e_sendoptions_utils_fill_component):
+ * gui/e-cal-model.c (search_by_id_and_client):
+ * gui/e-calendar-table.c (copy_row_cb),
+ (e_calendar_table_copy_clipboard):
+ * gui/e-calendar-view.c (e_calendar_view_copy_clipboard),
+ (icalcomp_contains_category):
+ * gui/e-day-view.c (model_rows_deleted_cb),
+ (e_day_view_find_event_from_uid), (e_day_view_reshape_day_events),
+ (e_day_view_on_drag_data_get):
+ * gui/e-itip-control.c (update_item):
+ * gui/e-memo-table.c (copy_row_cb), (e_memo_table_copy_clipboard):
+ * gui/e-memos.c (obtain_list_of_components):
+ * gui/e-tasks.c (obtain_list_of_components):
+ * gui/e-week-view.c (model_rows_deleted_cb),
+ (e_week_view_reshape_events), (e_week_view_find_event_from_uid):
+ * gui/gnome-cal.c (gnome_calendar_purge):
+ * gui/itip-utils.c (comp_limit_attendees), (itip_send_comp),
+ (reply_to_calendar_comp), (itip_publish_comp): Free the memory
+ returned by libical
+
+
2008-02-20 Milan Crha <mcrha@redhat.com>
** Fix for bug #440426
diff --git a/calendar/gui/dialogs/e-send-options-utils.c b/calendar/gui/dialogs/e-send-options-utils.c
index 2d776c1df6..9e498f3308 100644
--- a/calendar/gui/dialogs/e-send-options-utils.c
+++ b/calendar/gui/dialogs/e-send-options-utils.c
@@ -183,9 +183,14 @@ e_sendoptions_utils_fill_component (ESendOptionsDialog *sod, ECalComponent *comp
if (gopts->delay_enabled) {
struct icaltimetype temp;
+ char *str;
+
icaltimezone *zone = calendar_config_get_icaltimezone ();
temp = icaltime_from_timet_with_zone (gopts->delay_until, FALSE, zone);
- prop = icalproperty_new_x (icaltime_as_ical_string (temp));
+
+ str = icaltime_as_ical_string (temp);
+ prop = icalproperty_new_x (str);
+ g_free (str);
icalproperty_set_x_name (prop, "X-EVOLUTION-OPTIONS-DELAY");
icalcomponent_add_property (icalcomp, prop);
}
diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c
index 19fb146d3e..87c826a226 100644
--- a/calendar/gui/e-cal-model.c
+++ b/calendar/gui/e-cal-model.c
@@ -1297,7 +1297,8 @@ search_by_id_and_client (ECalModelPrivate *priv, ECal *client, const ECalCompone
ECalModelComponent *comp_data = g_ptr_array_index (priv->objects, i);
if (comp_data) {
- const char *uid, *rid;
+ const char *uid;
+ char *rid = NULL;
gboolean has_rid = (id->rid && *id->rid);
uid = icalcomponent_get_uid (comp_data->icalcomp);
@@ -1306,11 +1307,15 @@ search_by_id_and_client (ECalModelPrivate *priv, ECal *client, const ECalCompone
if (uid && *uid) {
if ((!client || comp_data->client == client) && !strcmp (id->uid, uid)) {
if (has_rid) {
- if (!(rid && *rid && !strcmp (rid, id->rid)))
+ if (!(rid && *rid && !strcmp (rid, id->rid))) {
+ g_free (rid);
continue;
+ }
}
+ g_free (rid);
return comp_data;
}
+ g_free (rid);
}
}
}
diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c
index 86703be736..8f5c5da9af 100644
--- a/calendar/gui/e-calendar-table.c
+++ b/calendar/gui/e-calendar-table.c
@@ -881,6 +881,7 @@ copy_row_cb (int model_row, gpointer data)
icalcomponent_new_clone (child));
icalcomponent_free (child);
}
+ g_free (child);
}
/**
@@ -917,6 +918,7 @@ e_calendar_table_copy_clipboard (ECalendarTable *cal_table)
/* free memory */
icalcomponent_free (cal_table->tmp_vcal);
+ g_free (comp_str);
cal_table->tmp_vcal = NULL;
}
diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c
index c1845eb992..0fa16b9ae9 100644
--- a/calendar/gui/e-calendar-view.c
+++ b/calendar/gui/e-calendar-view.c
@@ -771,6 +771,7 @@ e_calendar_view_copy_clipboard (ECalendarView *cal_view)
/* free memory */
icalcomponent_free (vcal_comp);
+ g_free (comp_str);
g_list_free (selected);
}
@@ -2297,11 +2298,13 @@ icalcomp_contains_category (icalcomponent *icalcomp, const gchar *category)
for (property = icalcomponent_get_first_property (icalcomp, ICAL_CATEGORIES_PROPERTY);
property != NULL;
property = icalcomponent_get_next_property (icalcomp, ICAL_CATEGORIES_PROPERTY)) {
- const char *value = icalproperty_get_value_as_string (property);
+ char *value = icalproperty_get_value_as_string (property);
if (value && strcmp (category, value) == 0){
+ g_free (value);
return TRUE;
}
+ g_free (value);
}
return FALSE;
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index bea06bc959..f6a71f31df 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -619,7 +619,8 @@ model_rows_deleted_cb (ETableModel *etm, int row, int count, gpointer user_data)
for (i = row + count; i > row; i--) {
gint day, event_num;
- const char *uid, *rid = NULL;
+ const char *uid = NULL;
+ char *rid = NULL;
ECalModelComponent *comp_data;
comp_data = e_cal_model_get_component_at (E_CAL_MODEL (etm), i - 1);
@@ -637,6 +638,7 @@ model_rows_deleted_cb (ETableModel *etm, int row, int count, gpointer user_data)
if (e_day_view_find_event_from_uid (day_view, comp_data->client, uid, rid, &day, &event_num))
e_day_view_remove_event_cb (day_view, day, event_num, NULL);
+ g_free (rid);
}
gtk_widget_queue_draw (day_view->top_canvas);
@@ -2641,7 +2643,8 @@ e_day_view_find_event_from_uid (EDayView *day_view,
{
EDayViewEvent *event;
gint day, event_num;
- const char *u, *r;
+ const char *u;
+ char *r = NULL;
if (!uid)
return FALSE;
@@ -2661,8 +2664,11 @@ e_day_view_find_event_from_uid (EDayView *day_view,
r = icaltime_as_ical_string (icalcomponent_get_recurrenceid (event->comp_data->icalcomp));
if (!r || !*r)
continue;
- if (strcmp (rid, r) != 0)
+ if (strcmp (rid, r) != 0) {
+ g_free (r);
continue;
+ }
+ g_free (r);
}
*day_return = day;
@@ -5815,13 +5821,17 @@ e_day_view_reshape_day_events (EDayView *day_view,
e_day_view_reshape_day_event (day_view, day, event_num);
event = &g_array_index (day_view->events[day], EDayViewEvent, event_num);
current_comp_string = icalcomponent_as_ical_string (event->comp_data->icalcomp);
- if (day_view->last_edited_comp_string == NULL)
+ if (day_view->last_edited_comp_string == NULL) {
+ g_free (current_comp_string);
continue;
+ }
+
if (strncmp (current_comp_string, day_view->last_edited_comp_string,50) == 0) {
e_canvas_item_grab_focus (event->canvas_item, TRUE);
g_free (day_view->last_edited_comp_string);
day_view-> last_edited_comp_string = NULL;
}
+ g_free (current_comp_string);
}
}
@@ -8951,6 +8961,7 @@ e_day_view_on_drag_data_get (GtkWidget *widget,
}
icalcomponent_free (vcal);
+ g_free (comp_str);
}
}
diff --git a/calendar/gui/e-itip-control.c b/calendar/gui/e-itip-control.c
index 2a46a0bc90..81a2458106 100644
--- a/calendar/gui/e-itip-control.c
+++ b/calendar/gui/e-itip-control.c
@@ -1914,6 +1914,7 @@ update_item (EItipControl *itip)
{
EItipControlPrivate *priv;
struct icaltimetype stamp;
+ char *str;
icalproperty *prop;
icalcomponent *clone;
GtkWidget *dialog;
@@ -1931,7 +1932,9 @@ update_item (EItipControl *itip)
* and you then look at it in Outlook).
*/
stamp = icaltime_current_time_with_zone (icaltimezone_get_utc_timezone ());
- prop = icalproperty_new_x (icaltime_as_ical_string (stamp));
+ str = icaltime_as_ical_string (stamp);
+ prop = icalproperty_new_x (str);
+ g_free (str);
icalproperty_set_x_name (prop, "X-MICROSOFT-CDO-REPLYTIME");
icalcomponent_add_property (priv->ical_comp, prop);
diff --git a/calendar/gui/e-memo-table.c b/calendar/gui/e-memo-table.c
index e877ccd940..8e9d3361fa 100644
--- a/calendar/gui/e-memo-table.c
+++ b/calendar/gui/e-memo-table.c
@@ -555,6 +555,7 @@ copy_row_cb (int model_row, gpointer data)
icalcomponent_new_clone (child));
icalcomponent_free (child);
}
+ g_free (comp_str);
}
static void
@@ -610,6 +611,7 @@ e_memo_table_copy_clipboard (EMemoTable *memo_table)
/* free memory */
icalcomponent_free (memo_table->tmp_vcal);
+ g_free (comp_str);
memo_table->tmp_vcal = NULL;
}
diff --git a/calendar/gui/e-memos.c b/calendar/gui/e-memos.c
index 69d1f8db68..ab2a90f825 100644
--- a/calendar/gui/e-memos.c
+++ b/calendar/gui/e-memos.c
@@ -423,6 +423,7 @@ obtain_list_of_components (gpointer data, gpointer user_data)
}
icalcomponent_free (vcal);
+ g_free (comp_str);
}
}
diff --git a/calendar/gui/e-tasks.c b/calendar/gui/e-tasks.c
index 33e4cdcb78..6167f4a70c 100644
--- a/calendar/gui/e-tasks.c
+++ b/calendar/gui/e-tasks.c
@@ -520,6 +520,7 @@ obtain_list_of_components (gpointer data, gpointer user_data)
}
icalcomponent_free (vcal);
+ g_free (comp_str);
}
}
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index 6dc8d0e73d..07d5b7b8eb 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -396,7 +396,8 @@ model_rows_deleted_cb (ETableModel *etm, int row, int count, gpointer user_data)
for (i = row + count; i > row; i--) {
gint event_num;
- const char *uid, *rid = NULL;
+ const char *uid;
+ char *rid = NULL;
ECalModelComponent *comp_data;
comp_data = e_cal_model_get_component_at (E_CAL_MODEL (etm), i - 1);
@@ -414,6 +415,7 @@ model_rows_deleted_cb (ETableModel *etm, int row, int count, gpointer user_data)
if (e_week_view_find_event_from_uid (week_view, comp_data->client, uid, rid, &event_num))
e_week_view_remove_event_cb (week_view, event_num, NULL);
+ g_free (rid);
}
gtk_widget_queue_draw (week_view->main_canvas);
@@ -2535,6 +2537,7 @@ e_week_view_reshape_events (EWeekView *week_view)
g_free (week_view->last_edited_comp_string);
week_view->last_edited_comp_string = NULL;
}
+ g_free (current_comp_string);
}
}
@@ -3663,7 +3666,8 @@ e_week_view_find_event_from_uid (EWeekView *week_view,
num_events = week_view->events->len;
for (event_num = 0; event_num < num_events; event_num++) {
- const char *u, *r;
+ const char *u;
+ char *r = NULL;
event = &g_array_index (week_view->events, EWeekViewEvent,
event_num);
@@ -3677,8 +3681,11 @@ e_week_view_find_event_from_uid (EWeekView *week_view,
r = icaltime_as_ical_string (icalcomponent_get_recurrenceid (event->comp_data->icalcomp));
if (!r || !*r)
continue;
- if (strcmp (rid, r) != 0)
+ if (strcmp (rid, r) != 0) {
+ g_free (r);
continue;
+ }
+ g_free (r);
}
*event_num_return = event_num;
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index bcd5cda400..e955b7be32 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -3819,13 +3819,14 @@ gnome_calendar_purge (GnomeCalendar *gcal, time_t older_than)
GError *error = NULL;
if (e_cal_util_component_is_instance (m->data) || e_cal_util_component_has_recurrences (m->data)) {
- const char *rid = NULL;
+ char *rid = NULL;
struct icaltimetype recur_id = icalcomponent_get_recurrenceid (m->data);
if (!icaltime_is_null_time (recur_id) )
rid = icaltime_as_ical_string (recur_id);
e_cal_remove_object_with_mod (client, uid, rid, CALOBJ_MOD_ALL, &error);
+ g_free (rid);
} else {
e_cal_remove_object (client, uid, &error);
}
diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c
index 3022b4f6aa..173817f713 100644
--- a/calendar/gui/itip-utils.c
+++ b/calendar/gui/itip-utils.c
@@ -884,7 +884,7 @@ comp_limit_attendees (ECalComponent *comp)
prop != NULL;
prop = icalcomponent_get_next_property (icomp, ICAL_ATTENDEE_PROPERTY))
{
- const char *attendee;
+ char *attendee;
char *attendee_text;
icalparameter *param;
const char *attendee_sentby;
@@ -901,6 +901,7 @@ comp_limit_attendees (ECalComponent *comp)
continue;
attendee_text = g_strdup (itip_strip_mailto (attendee));
+ g_free (attendee);
attendee_text = g_strstrip (attendee_text);
found = match = e_account_list_find(itip_addresses_get(), E_ACCOUNT_FIND_ID_ADDRESS, attendee_text) != NULL;
@@ -1228,7 +1229,7 @@ itip_send_comp (ECalComponentItipMethod method, ECalComponent *send_comp,
CORBA_char *subject = NULL, *body = NULL, *content_type = NULL;
CORBA_char *from = NULL, *filename = NULL, *description = NULL;
GNOME_Evolution_Composer_AttachmentData *attach_data = NULL;
- char *ical_string;
+ char *ical_string = NULL;
CORBA_Environment ev;
gboolean retval = FALSE;
@@ -1388,6 +1389,7 @@ itip_send_comp (ECalComponentItipMethod method, ECalComponent *send_comp,
CORBA_free (attach_data->_buffer);
CORBA_free (attach_data);
}
+ g_free (ical_string);
return retval;
}
@@ -1406,7 +1408,7 @@ reply_to_calendar_comp (ECalComponentItipMethod method, ECalComponent *send_comp
CORBA_char *subject = NULL, *content_type = NULL;
char tmp [256];
CORBA_char *from = NULL;
- char *ical_string;
+ char *ical_string = NULL;
CORBA_Environment ev;
gboolean retval = FALSE;
@@ -1591,7 +1593,7 @@ reply_to_calendar_comp (ECalComponentItipMethod method, ECalComponent *send_comp
CORBA_free (subject);
if (content_type != NULL)
CORBA_free (content_type);
-
+ g_free (ical_string);
return retval;
}
@@ -1749,7 +1751,7 @@ itip_publish_comp (ECal *client, gchar *uri, gchar *username,
SoupSession *session;
SoupMessage *msg;
SoupURI *real_uri;
- char *ical_string;
+ char *ical_string = NULL;
toplevel = e_cal_util_new_top_level ();
icalcomponent_set_method (toplevel, ICAL_METHOD_PUBLISH);
@@ -1761,7 +1763,6 @@ itip_publish_comp (ECal *client, gchar *uri, gchar *username,
icomp = comp_fb_normalize (icalcomp);
icalcomponent_add_component (toplevel, icomp);
- ical_string = icalcomponent_as_ical_string (toplevel);
/* Publish the component */
session = soup_session_async_new ();
@@ -1784,7 +1785,9 @@ itip_publish_comp (ECal *client, gchar *uri, gchar *username,
g_object_unref (session);
return FALSE;
}
+
soup_message_set_flags (msg, SOUP_MESSAGE_NO_REDIRECT);
+ ical_string = icalcomponent_as_ical_string (toplevel);
soup_message_set_request (msg, "text/calendar", SOUP_MEMORY_TEMPORARY,
ical_string, strlen (ical_string));
@@ -1796,11 +1799,13 @@ itip_publish_comp (ECal *client, gchar *uri, gchar *username,
msg->reason_phrase);
g_object_unref (msg);
g_object_unref (session);
+ g_free (ical_string);
return FALSE;
}
g_object_unref (msg);
g_object_unref (session);
+ g_free (ical_string);
return TRUE;
}