aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-04-23 22:44:37 +0800
committerMilan Crha <mcrha@redhat.com>2012-04-23 22:44:37 +0800
commitb8dcb774d37c7ce7b3c9f7cd829c6ab08c298386 (patch)
tree80f2d40098eb4cf51de34f9a735b001de8fd818b
parent9f5fd34ba53e314bf77cd1fd9b023ac245e053d8 (diff)
downloadgsoc2013-evolution-b8dcb774d37c7ce7b3c9f7cd829c6ab08c298386.tar.gz
gsoc2013-evolution-b8dcb774d37c7ce7b3c9f7cd829c6ab08c298386.tar.zst
gsoc2013-evolution-b8dcb774d37c7ce7b3c9f7cd829c6ab08c298386.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 086f3ef494..3697ce5daa 100644
--- a/calendar/gui/dialogs/event-page.c
+++ b/calendar/gui/dialogs/event-page.c
@@ -2918,6 +2918,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;
}
}
@@ -2944,8 +2945,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 5348a19328..bcac7ad71c 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 71a494541a..d0395cbb8d 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 20dee7f714..d3c9a52195 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 3877e37306..8095d26647 100644
--- a/plugins/itip-formatter/itip-formatter.c
+++ b/plugins/itip-formatter/itip-formatter.c
@@ -899,7 +899,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;