Bug #628299 - Crash in g_variant_is_trusted.
authorBharath Acharya <abharath@novell.com>
Thu, 9 Sep 2010 10:27:27 +0000 (15:57 +0530)
committerBharath Acharya <abharath@novell.com>
Thu, 9 Sep 2010 10:27:27 +0000 (15:57 +0530)
Initialize the error message. Fixes the crash. Need to fix the right error
message from the server later..

calendar/backends/groupwise/e-cal-backend-groupwise.c
servers/groupwise/e-gw-connection.c

index 14ab019..0d1b659 100644 (file)
@@ -1021,6 +1021,9 @@ connect_to_server (ECalBackendGroupwise *cbgw, GError **perror)
                return;
        }
 
+       errors.status = E_GW_CONNECTION_STATUS_OK;
+       errors.description = NULL;
+
        kind = e_cal_backend_get_kind (E_CAL_BACKEND (cbgw));
 
        parent_user = (gchar *) e_source_get_property (source, "parent_id_name");
@@ -1085,9 +1088,14 @@ connect_to_server (ECalBackendGroupwise *cbgw, GError **perror)
                if (errors.status == E_GW_CONNECTION_STATUS_INVALID_PASSWORD) {
                        g_propagate_error (perror, EDC_ERROR (AuthenticationFailed));
                        return;
+               } else if (errors.status == E_GW_CONNECTION_STATUS_UNKNOWN) {
+                       g_propagate_error (perror,EDC_ERROR (OtherError));
+                       return;
                }
 
                g_propagate_error (perror, EDC_ERROR_EX (OtherError, _(errors.description)));
+               if (errors.description)
+                       g_free (errors.description);
                return;
        }
        priv->mode_changed = FALSE;
index 8b7d259..a35574a 100644 (file)
@@ -534,6 +534,7 @@ e_gw_connection_new_with_error_handler (const gchar *uri, const gchar *username,
        response = e_gw_connection_send_message (cnc, msg);
 
        if (!response) {
+               errors->status = E_GW_CONNECTION_STATUS_UNKNOWN;
                g_object_unref (cnc);
                g_static_mutex_unlock (&connecting);
                g_object_unref (msg);