aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-04-23 22:43:08 +0800
committerMilan Crha <mcrha@redhat.com>2012-04-23 22:43:08 +0800
commit3506b02eedc49959bf3e04c7f569ef2b4d8c1ee7 (patch)
tree4177727b83f2af82872fac5832546306792ca0ab
parente2832731d2594be58d9581075dc25a9845893b1d (diff)
downloadgsoc2013-evolution-3506b02eedc49959bf3e04c7f569ef2b4d8c1ee7.tar.gz
gsoc2013-evolution-3506b02eedc49959bf3e04c7f569ef2b4d8c1ee7.tar.zst
gsoc2013-evolution-3506b02eedc49959bf3e04c7f569ef2b4d8c1ee7.zip
Fix possible memory leaks of GError structures
-rw-r--r--calendar/gui/dialogs/event-page.c4
-rw-r--r--calendar/gui/dialogs/memo-page.c4
-rw-r--r--calendar/gui/dialogs/recurrence-page.c6
-rw-r--r--calendar/gui/dialogs/task-page.c4
-rw-r--r--calendar/gui/e-cal-model.c1
-rw-r--r--plugins/itip-formatter/itip-formatter.c2
6 files changed, 14 insertions, 7 deletions
diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c
index a3c2b496ea..37373dffa5 100644
--- a/calendar/gui/dialogs/event-page.c
+++ b/calendar/gui/dialogs/event-page.c
@@ -2920,6 +2920,7 @@ epage_client_opened_cb (GObject *source_object,
if (!e_client_utils_open_new_finish (source, result, &client, &error)) {
if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) ||
g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+ g_clear_error (&error);
return;
}
}
@@ -2946,8 +2947,7 @@ epage_client_opened_cb (GObject *source_object,
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
- if (error)
- g_error_free (error);
+ g_clear_error (&error);
} else {
gchar *backend_addr = NULL;
icaltimezone *zone;
diff --git a/calendar/gui/dialogs/memo-page.c b/calendar/gui/dialogs/memo-page.c
index 58d3d3b207..00bf1cc79b 100644
--- a/calendar/gui/dialogs/memo-page.c
+++ b/calendar/gui/dialogs/memo-page.c
@@ -927,6 +927,7 @@ mpage_client_opened_cb (GObject *source_object,
if (!e_client_utils_open_new_finish (source, result, &client, &error)) {
if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) ||
g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+ g_clear_error (&error);
return;
}
}
@@ -952,8 +953,7 @@ mpage_client_opened_cb (GObject *source_object,
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
- if (error)
- g_error_free (error);
+ g_clear_error (&error);
} else {
icaltimezone *zone;
CompEditorFlags flags;
diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c
index 838ab76c4d..56601cee74 100644
--- a/calendar/gui/dialogs/recurrence-page.c
+++ b/calendar/gui/dialogs/recurrence-page.c
@@ -634,8 +634,11 @@ rpage_get_objects_for_uid_cb (GObject *source_object,
ecalcomps = NULL;
if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) ||
g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+ g_clear_error (&error);
return;
}
+
+ g_clear_error (&error);
}
update_with_readonly (rpage, g_slist_length (ecalcomps) > 1);
@@ -659,8 +662,11 @@ rpage_get_object_cb (GObject *source_object,
icalcomp = NULL;
if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) ||
g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+ g_clear_error (&error);
return;
}
+
+ g_clear_error (&error);
}
if (icalcomp) {
diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c
index 9e051af37d..27be3bd6bd 100644
--- a/calendar/gui/dialogs/task-page.c
+++ b/calendar/gui/dialogs/task-page.c
@@ -1755,6 +1755,7 @@ tpage_client_opened_cb (GObject *source_object,
if (!e_client_utils_open_new_finish (source, result, &client, &error)) {
if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) ||
g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+ g_clear_error (&error);
return;
}
}
@@ -1780,8 +1781,7 @@ tpage_client_opened_cb (GObject *source_object,
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
- if (error)
- g_error_free (error);
+ g_clear_error (&error);
} else {
icaltimezone *zone;
ECalClient *cal_client = E_CAL_CLIENT (client);
diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c
index d56b7583fd..d1ab22c989 100644
--- a/calendar/gui/e-cal-model.c
+++ b/calendar/gui/e-cal-model.c
@@ -2733,6 +2733,7 @@ get_view_cb (GObject *source_object,
}
if (gvd->tries < 10) {
+ g_clear_error (&error);
gvd->tries++;
g_timeout_add (500, retry_get_view_timeout_cb, gvd);
return;
diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c
index 16f7a21d53..f2e92a0230 100644
--- a/plugins/itip-formatter/itip-formatter.c
+++ b/plugins/itip-formatter/itip-formatter.c
@@ -906,7 +906,7 @@ get_object_with_rid_ready_cb (GObject *source_object,
if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) ||
g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) ||
g_cancellable_is_cancelled (fd->cancellable)) {
- g_error_free (error);
+ g_clear_error (&error);
find_cal_update_ui (fd, cal_client);
decrease_find_data (fd);
return;