[evolution-ews] handle a missing error condition



commit 308526b20441a4e09da7e3cfadf07706709ad4cb
Author: Chenthill Palanisamy <pchenthill novell com>
Date:   Tue Jun 21 13:00:54 2011 +0530

    handle a missing error condition

 src/server/e-ews-connection.c |   24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)
---
diff --git a/src/server/e-ews-connection.c b/src/server/e-ews-connection.c
index 70ba2ad..353ad52 100644
--- a/src/server/e-ews-connection.c
+++ b/src/server/e-ews-connection.c
@@ -982,6 +982,7 @@ autodiscover_response_cb (SoupSession *session, SoupMessage *msg, gpointer data)
 	xmlDoc *doc;
 	xmlNode *node;
 	int idx;
+	gboolean success = FALSE;
 
 	for (idx = 0; idx < 2; idx++) {
 		if (ad->msgs[idx] == msg)
@@ -1059,20 +1060,21 @@ autodiscover_response_cb (SoupSession *session, SoupMessage *msg, gpointer data)
 	for (node = node->children; node; node = node->next) {
 		if (node->type == XML_ELEMENT_NODE &&
 		    !strcmp((char *)node->name, "Protocol")) {
-		    	if (autodiscover_parse_protocol(node, urls))
-				break;
-			else {
-				g_free (urls->as_url);
-				g_free (urls->oab_url);
-				g_free (urls);
-				g_set_error	(&error, EWS_CONNECTION_ERROR,
-						 -1,
-						 _("Failed to find <ASUrl> and <OABUrl> in autodiscover response"));
-				goto failed;
-			}
+		    	success = autodiscover_parse_protocol(node, urls);
+			break;
 		}
 	}
 
+	if (!success) {
+		g_free (urls->as_url);
+		g_free (urls->oab_url);
+		g_free (urls);
+		g_set_error	(&error, EWS_CONNECTION_ERROR,
+				-1,
+				_("Failed to find <ASUrl> and <OABUrl> in autodiscover response"));
+		goto failed;
+	}
+
 	/* We have a good response; cancel all the others */
 	for (idx = 0; idx < 2; idx++) {
 		if (ad->msgs[idx]) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]