From 73716c500bc2f9dd2c0057b3d57ccc340d5e1017 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 15 Jan 2010 22:19:49 -0500 Subject: Fix some potential null pointer dereferences. Caught by the Clang Static Analyzer. --- modules/calendar/e-cal-shell-backend.c | 6 ++++-- modules/calendar/e-memo-shell-backend.c | 6 ++++-- modules/calendar/e-task-shell-backend.c | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/modules/calendar/e-cal-shell-backend.c b/modules/calendar/e-cal-shell-backend.c index bf6f2e1189..232e8461c3 100644 --- a/modules/calendar/e-cal-shell-backend.c +++ b/modules/calendar/e-cal-shell-backend.c @@ -600,9 +600,11 @@ cal_shell_backend_handle_uri_cb (EShellBackend *shell_backend, client = auth_new_cal_from_source (source, source_type); if (client == NULL || !e_cal_open (client, TRUE, &error)) { - g_printerr ("%s\n", error->message); + if (error != NULL) { + g_printerr ("%s\n", error->message); + g_error_free (error); + } g_object_unref (source_list); - g_error_free (error); goto exit; } diff --git a/modules/calendar/e-memo-shell-backend.c b/modules/calendar/e-memo-shell-backend.c index 067613e0c5..10a1ea99e7 100644 --- a/modules/calendar/e-memo-shell-backend.c +++ b/modules/calendar/e-memo-shell-backend.c @@ -426,9 +426,11 @@ memo_shell_backend_handle_uri_cb (EShellBackend *shell_backend, client = auth_new_cal_from_source (source, source_type); if (client == NULL || !e_cal_open (client, TRUE, &error)) { - g_printerr ("%s\n", error->message); + if (error != NULL) { + g_printerr ("%s\n", error->message); + g_error_free (error); + } g_object_unref (source_list); - g_error_free (error); goto exit; } diff --git a/modules/calendar/e-task-shell-backend.c b/modules/calendar/e-task-shell-backend.c index d20a359e7d..1a8bee5a03 100644 --- a/modules/calendar/e-task-shell-backend.c +++ b/modules/calendar/e-task-shell-backend.c @@ -431,9 +431,11 @@ task_shell_backend_handle_uri_cb (EShellBackend *shell_backend, client = auth_new_cal_from_source (source, source_type); if (client == NULL || !e_cal_open (client, TRUE, &error)) { - g_printerr ("%s\n", error->message); + if (error != NULL) { + g_printerr ("%s\n", error->message); + g_error_free (error); + } g_object_unref (source_list); - g_error_free (error); goto exit; } -- cgit