Index: evolution-data-server/servers/exchange/storage/exchange-account.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/exchange/storage/exchange-account.c,v
retrieving revision 1.27
diff -u -p -r1.27 exchange-account.c
--- evolution-data-server/servers/exchange/storage/exchange-account.c	31 Jan 2006 12:51:15 -0000	1.27
+++ evolution-data-server/servers/exchange/storage/exchange-account.c	1 Feb 2006 06:31:53 -0000
@@ -1517,6 +1517,8 @@ exchange_account_connect (ExchangeAccoun
 		account->priv->connecting = FALSE;
 		*info_result = EXCHANGE_ACCOUNT_UNKNOWN_ERROR;
 		g_mutex_unlock (account->priv->connect_lock);
+		if (nresults)
+			e2k_results_free (results, nresults);
 		return NULL; /* FIXME: what error has happened? */
 	}
 
@@ -1534,6 +1536,7 @@ exchange_account_connect (ExchangeAccoun
 		timezone = e2k_properties_get_prop (results[0].props, E2K_PR_EXCHANGE_TIMEZONE);
 		if (timezone)
 			account->default_timezone = g_strdup (timezone);
+		e2k_results_free (results, nresults);
 	}
 
 	if (!setup_account_hierarchies (account)) {
@@ -1686,8 +1689,11 @@ exchange_account_get_standard_uri_for (E
 				       &results, &nresults);
 	g_free (foreign_uri);
 
-	if (!E2K_HTTP_STATUS_IS_SUCCESSFUL (status) || nresults == 0)
+	if (!E2K_HTTP_STATUS_IS_SUCCESSFUL (status) || nresults == 0) {
+		if (nresults)
+			e2k_results_free (results, nresults);
 		return NULL;
+	}
 
 	prop = e2k_properties_get_prop (results[0].props, std_uri_prop);
 	if (prop)
Index: evolution-data-server/servers/exchange/storage/e-folder-exchange.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/exchange/storage/e-folder-exchange.c,v
retrieving revision 1.9
diff -u -p -r1.9 e-folder-exchange.c
--- evolution-data-server/servers/exchange/storage/e-folder-exchange.c	10 Jan 2006 07:57:46 -0000	1.9
+++ evolution-data-server/servers/exchange/storage/e-folder-exchange.c	1 Feb 2006 06:33:14 -0000
@@ -442,14 +442,15 @@ e_folder_exchange_save_to_file (EFolder 
 	physical_uri = e_folder_get_physical_uri (folder);
 	internal_uri = e_folder_exchange_get_internal_uri (folder);
 	permanent_uri = e_folder_exchange_get_permanent_uri (folder);
+
+	g_return_val_if_fail (name && type && physical_uri && internal_uri,
+			      FALSE);
+
 	if ((fsize = e_folder_exchange_get_folder_size (folder)) >= 0)
 		folder_size = g_strdup_printf ("%llu", fsize);
 	else
 		return FALSE;
 
-	g_return_val_if_fail (name && type && physical_uri && internal_uri,
-			      FALSE);
-
 	doc = xmlNewDoc ("1.0");
 	root = xmlNewDocNode (doc, NULL, "connector-folder", NULL);
 	xmlNewProp (root, "version", "1");
@@ -470,6 +471,8 @@ e_folder_exchange_save_to_file (EFolder 
 		g_unlink (filename);
 
 	xmlFreeDoc (doc);
+
+	g_free (folder_size);
 
 	return status == 0;
 }
Index: evolution-data-server/servers/exchange/storage/exchange-hierarchy-favorites.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/exchange/storage/exchange-hierarchy-favorites.c,v
retrieving revision 1.6
diff -u -p -r1.6 exchange-hierarchy-favorites.c
--- evolution-data-server/servers/exchange/storage/exchange-hierarchy-favorites.c	31 Aug 2005 04:26:09 -0000	1.6
+++ evolution-data-server/servers/exchange/storage/exchange-hierarchy-favorites.c	1 Feb 2006 06:34:08 -0000
@@ -155,6 +155,9 @@ get_hrefs (ExchangeHierarchySomeDAV *hsd
 					     g_strdup (shortcut_uri));
 			e2k_results_free (results, nresults);
 		}
+		else if (nresults) {
+			e2k_results_free (results, nresults);
+		}
 
 		g_free (perm_url);
 	}
Index: evolution-data-server/servers/exchange/storage/exchange-hierarchy-foreign.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/exchange/storage/exchange-hierarchy-foreign.c,v
retrieving revision 1.7
diff -u -p -r1.7 exchange-hierarchy-foreign.c
--- evolution-data-server/servers/exchange/storage/exchange-hierarchy-foreign.c	17 Dec 2005 07:23:12 -0000	1.7
+++ evolution-data-server/servers/exchange/storage/exchange-hierarchy-foreign.c	1 Feb 2006 06:35:37 -0000
@@ -150,6 +150,8 @@ check_hide_private (ExchangeHierarchy *h
 	hfor->priv->checked_hide_private = TRUE;
 
 	if (!E2K_HTTP_STATUS_IS_SUCCESSFUL (status) || nresults == 0) {
+		if (nresults)
+			e2k_results_free (results, nresults);
 		g_mutex_unlock (hfor->priv->hide_private_lock);
 		return;
 	}
@@ -226,14 +228,19 @@ find_folder (ExchangeHierarchy *hier, co
 	status = e2k_context_propfind (ctx, NULL, uri,
 				       folder_props, n_folder_props,
 				       &results, &nresults);
-	if (!E2K_HTTP_STATUS_IS_SUCCESSFUL (status)) 
+	if (!E2K_HTTP_STATUS_IS_SUCCESSFUL (status)) {
+		if (nresults)
+			e2k_results_free (results, nresults);
 		return exchange_hierarchy_webdav_status_to_folder_result (status);
+	}
 	if (nresults == 0)
 		return EXCHANGE_ACCOUNT_FOLDER_DOES_NOT_EXIST;
 
 	access = e2k_properties_get_prop (results[0].props, PR_ACCESS);
-	if (!access || !atoi (access))
+	if (!access || !atoi (access)) {
+		e2k_results_free (results, nresults);
 		return EXCHANGE_ACCOUNT_FOLDER_PERMISSION_DENIED;
+	}
 
 	folder = exchange_hierarchy_webdav_parse_folder (hwd, hier->toplevel,
 							 &results[0]);
Index: evolution-data-server/servers/exchange/storage/exchange-hierarchy-somedav.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/exchange/storage/exchange-hierarchy-somedav.c,v
retrieving revision 1.6
diff -u -p -r1.6 exchange-hierarchy-somedav.c
--- evolution-data-server/servers/exchange/storage/exchange-hierarchy-somedav.c	17 Dec 2005 07:23:12 -0000	1.6
+++ evolution-data-server/servers/exchange/storage/exchange-hierarchy-somedav.c	1 Feb 2006 06:36:14 -0000
@@ -238,13 +238,18 @@ exchange_hierarchy_somedav_add_folder (E
 	status = e2k_context_propfind (ctx, NULL, uri,
 				       folder_props, n_folder_props,
 				       &results, &nresults);
-	if (!E2K_HTTP_STATUS_IS_SUCCESSFUL (status)) 
+	if (!E2K_HTTP_STATUS_IS_SUCCESSFUL (status)) {
+		if (nresults)
+			e2k_results_free (results, nresults);
 		return exchange_hierarchy_webdav_status_to_folder_result (status);
+	}
 	if (nresults == 0)
 		return EXCHANGE_ACCOUNT_FOLDER_DOES_NOT_EXIST;
 
-	if (folder_is_unreadable (results[0].props))
+	if (folder_is_unreadable (results[0].props)) {
+		e2k_results_free (results, nresults);
 		return EXCHANGE_ACCOUNT_FOLDER_PERMISSION_DENIED;
+	}
 
 	folder = exchange_hierarchy_webdav_parse_folder (hwd, hier->toplevel,
 							 &results[0]);
Index: evolution-data-server/servers/exchange/storage/exchange-hierarchy-webdav.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/exchange/storage/exchange-hierarchy-webdav.c,v
retrieving revision 1.8
diff -u -p -r1.8 exchange-hierarchy-webdav.c
--- evolution-data-server/servers/exchange/storage/exchange-hierarchy-webdav.c	17 Dec 2005 07:23:12 -0000	1.8
+++ evolution-data-server/servers/exchange/storage/exchange-hierarchy-webdav.c	1 Feb 2006 06:36:48 -0000
@@ -729,6 +729,7 @@ scan_subtree (ExchangeHierarchy *hier, E
 			subtrees = g_slist_prepend (subtrees, folder);
 		}
 		exchange_hierarchy_new_folder (hier, folder);
+		g_object_unref (folder);
 
 		/* Check the folder size here */
 		name = e2k_properties_get_prop (result->props,
Index: evolution-data-server/servers/exchange/storage/exchange-esource.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/exchange/storage/exchange-esource.c,v
retrieving revision 1.9
diff -u -p -r1.9 exchange-esource.c
--- evolution-data-server/servers/exchange/storage/exchange-esource.c	14 Jan 2006 12:02:14 -0000	1.9
+++ evolution-data-server/servers/exchange/storage/exchange-esource.c	1 Feb 2006 06:37:24 -0000
@@ -105,8 +105,10 @@ add_folder_esource (ExchangeAccount *acc
 		}
 		e_source_set_property (source, "username", username);
 		e_source_set_property (source, "auth-domain", "Exchange");
-		if (authtype)
+		if (authtype) {
 			e_source_set_property (source, "auth-type", authtype);
+			g_free (authtype);
+		}
 		if (is_contacts_folder)
 			e_source_set_property (source, "auth", "plain/password");
 		else
@@ -134,8 +136,10 @@ add_folder_esource (ExchangeAccount *acc
 
 			e_source_set_property (source, "username", username);
 			e_source_set_property (source, "auth-domain", "Exchange");
-			if (authtype)
+			if (authtype) {
 				e_source_set_property (source, "auth-type", authtype);
+				g_free (authtype);
+			}
 			if (is_contacts_folder)
 				e_source_set_property (source, "auth", "plain/password");
 			else
Index: evolution-data-server/servers/exchange/storage/exchange-oof.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/exchange/storage/exchange-oof.c,v
retrieving revision 1.3
diff -u -p -r1.3 exchange-oof.c
--- evolution-data-server/servers/exchange/storage/exchange-oof.c	25 Nov 2005 04:03:44 -0000	1.3
+++ evolution-data-server/servers/exchange/storage/exchange-oof.c	1 Feb 2006 06:38:05 -0000
@@ -91,8 +91,11 @@ exchange_oof_get (ExchangeAccount *accou
 		status = e2k_context_propfind (ctx, NULL, url, &prop, 1,
 					       &results, &nresults);
 		g_free (url);
-		if (!E2K_HTTP_STATUS_IS_SUCCESSFUL (status) || nresults == 0)
+		if (!E2K_HTTP_STATUS_IS_SUCCESSFUL (status) || nresults == 0) {
+			if (nresults)
+				e2k_results_free (results, nresults);
 			return FALSE;
+		}
 
 		prop = e2k_properties_get_prop (results[0].props, E2K_PR_EXCHANGE_OOF_STATE);
 		*oof = prop && atoi (prop);
Index: evolution-data-server/servers/exchange/lib/e2k-freebusy.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/exchange/lib/e2k-freebusy.c,v
retrieving revision 1.3
diff -u -p -r1.3 e2k-freebusy.c
--- evolution-data-server/servers/exchange/lib/e2k-freebusy.c	31 Aug 2005 04:26:08 -0000	1.3
+++ evolution-data-server/servers/exchange/lib/e2k-freebusy.c	1 Feb 2006 06:38:38 -0000
@@ -189,6 +189,8 @@ e2k_freebusy_new (E2kContext *ctx, const
 	if (!E2K_HTTP_STATUS_IS_SUCCESSFUL (status) || nresults == 0) {
 		/* FIXME: create it */
 		g_free (uri);
+		if (nresults)
+			e2k_results_free (results, nresults);
 		return NULL;
 	}
 
Index: evolution-exchange/addressbook/e-book-backend-exchange.c
===================================================================
RCS file: /cvs/gnome/evolution-exchange/addressbook/e-book-backend-exchange.c,v
retrieving revision 1.48
diff -u -p -r1.48 e-book-backend-exchange.c
--- evolution-exchange/addressbook/e-book-backend-exchange.c	23 Jan 2006 08:39:14 -0000	1.48
+++ evolution-exchange/addressbook/e-book-backend-exchange.c	1 Feb 2006 06:39:43 -0000
@@ -564,6 +564,8 @@ e_book_backend_exchange_connect (EBookBa
 
 	if (status != E2K_HTTP_MULTI_STATUS) {
 		bepriv->connected = FALSE;
+		if (nresults)
+			e2k_results_free (results, nresults);
 		return GNOME_Evolution_Addressbook_OtherError;
 	}
 
@@ -575,6 +577,8 @@ e_book_backend_exchange_connect (EBookBa
 
 	if (!(access & MAPI_ACCESS_READ)) {
 		bepriv->connected = FALSE;
+		if (nresults)
+			e2k_results_free (results, nresults);
 		return GNOME_Evolution_Addressbook_PermissionDenied;
 	}
 
@@ -1384,6 +1388,8 @@ e_book_backend_exchange_modify_contact (
 			g_object_unref (book);
 			g_object_unref (*contact);
 			*contact = NULL;
+			if (nresults)
+				e2k_results_free (results, nresults);
 			return GNOME_Evolution_Addressbook_OtherError;
 		}
 
@@ -1392,6 +1398,7 @@ e_book_backend_exchange_modify_contact (
 		else
 			old_contact = NULL;
 
+		e2k_results_free (results, nresults);
 		props = props_from_contact (be, *contact, old_contact);
 		status = e2k_context_proppatch (bepriv->ctx, NULL, uri,
 						props, FALSE, NULL);
Index: evolution-exchange/calendar/e-cal-backend-exchange.c
===================================================================
RCS file: /cvs/gnome/evolution-exchange/calendar/e-cal-backend-exchange.c,v
retrieving revision 1.55
diff -u -p -r1.55 e-cal-backend-exchange.c
--- evolution-exchange/calendar/e-cal-backend-exchange.c	18 Jan 2006 13:07:41 -0000	1.55
+++ evolution-exchange/calendar/e-cal-backend-exchange.c	1 Feb 2006 06:40:38 -0000
@@ -382,6 +382,7 @@ open_calendar (ECalBackendSync *backend,
 		if (prop)
 			access = atoi (prop);
 	}
+	e2k_results_free (results, nresults);
 
 	if (!(access & MAPI_ACCESS_READ)) {
 		g_mutex_unlock (cbex->priv->open_lock);
@@ -1428,8 +1429,8 @@ check_change_type (gpointer key, gpointe
 		}
 		
 		g_free (calobj);
+		g_object_unref (comp);		
 	}
-	g_object_unref (comp);		
 }
 
 struct cbe_data {
Index: evolution-exchange/mail/mail-stub-exchange.c
===================================================================
RCS file: /cvs/gnome/evolution-exchange/mail/mail-stub-exchange.c,v
retrieving revision 1.32
diff -u -p -r1.32 mail-stub-exchange.c
--- evolution-exchange/mail/mail-stub-exchange.c	17 Dec 2005 07:27:19 -0000	1.32
+++ evolution-exchange/mail/mail-stub-exchange.c	1 Feb 2006 06:43:34 -0000
@@ -577,12 +577,16 @@ get_folder_online (MailStubExchangeFolde
 		if (!background) {
 			got_folder_error (mfld, _("Could not open folder: Permission denied"));
 		}
+		if (nresults)
+			e2k_results_free (results, nresults);	
 		return FALSE;
 	} else if (!E2K_HTTP_STATUS_IS_SUCCESSFUL (status)) {
 		g_warning ("got_folder_props: %d", status);
 		if (!background) {
 			got_folder_error (mfld, _("Could not open folder"));
 		}
+		if (nresults)
+			e2k_results_free (results, nresults);
 		return FALSE;
 	}
 
@@ -599,6 +603,7 @@ get_folder_online (MailStubExchangeFolde
 		if (!background) {
 			got_folder_error (mfld, _("Could not open folder: Permission denied"));
 		}
+		e2k_results_free (results, nresults);
 		return FALSE;
 	}
 	readonly = (mfld->access & (MAPI_ACCESS_MODIFY | MAPI_ACCESS_CREATE_CONTENTS)) == 0;
@@ -607,6 +612,8 @@ get_folder_online (MailStubExchangeFolde
 	if (prop)
 		mfld->deleted_count = atoi (prop);
 
+	e2k_results_free (results, nresults);
+
 	rn = e2k_restriction_andv (
 		e2k_restriction_prop_bool (E2K_PR_DAV_IS_COLLECTION,
 					   E2K_RELOP_EQ, FALSE),
@@ -893,6 +900,8 @@ sync_deletions (MailStubExchange *mse, M
 					     &results, &nresults);
 
 	if (!E2K_HTTP_STATUS_IS_SUCCESSFUL (status) || !nresults) {
+		if (nresults)
+			e2k_results_free (results, nresults);
 		g_warning ("got_sync_deleted_props: %d", status);
 		return;
 	}
@@ -907,6 +916,8 @@ sync_deletions (MailStubExchange *mse, M
 	if (prop)
 		visible_count = atoi (prop);
 
+	e2k_results_free (results, nresults);
+
 	if (visible_count >= mfld->messages->len) {
 		if (mfld->deleted_count == deleted_count)
 			return;
@@ -1872,6 +1883,8 @@ get_stickynote (E2kContext *ctx, E2kOper
 		g_string_free (message, FALSE);
 		e2k_results_free (results, nresults);
 	}
+	else if (nresults)
+		e2k_results_free (results, nresults);
 
 	return status;
 }
@@ -1891,12 +1904,16 @@ build_message_from_document (E2kContext 
 				       mapi_message_props,
 				       n_mapi_message_props,
 				       &results, &nresults);
-	if (!E2K_HTTP_STATUS_IS_SUCCESSFUL (status))
+	if (!E2K_HTTP_STATUS_IS_SUCCESSFUL (status)) {
+		if (nresults)
+			e2k_results_free (results, nresults);
 		return status;
+	}
 	if (!nresults)
 		return E2K_HTTP_MALFORMED;
 
 	headers = mail_util_mapi_to_smtp_headers (results[0].props);
+	e2k_results_free (results, nresults);
 
 	message = g_byte_array_new ();
 	g_byte_array_append (message, headers, strlen (headers));
@@ -1929,12 +1946,16 @@ unmangle_delegated_meeting_request (Mail
 
 	status = e2k_context_propfind (mse->ctx, op, uri, &prop, 1,
 				       &results, &nresults);
-	if (!E2K_HTTP_STATUS_IS_SUCCESSFUL (status))
+	if (!E2K_HTTP_STATUS_IS_SUCCESSFUL (status)) {
+		if (nresults)
+			e2k_results_free (results, nresults);
 		return status;
+	}
 	if (!nresults)
 		return E2K_HTTP_MALFORMED;
 
 	delegator_dn = e2k_properties_get_prop (results[0].props, PR_RCVD_REPRESENTING_EMAIL_ADDRESS);
+	e2k_results_free (results, nresults);
 	if (!delegator_dn)
 		return E2K_HTTP_OK;
 
Index: evolution-exchange/storage/exchange-config-listener.c
===================================================================
RCS file: /cvs/gnome/evolution-exchange/storage/exchange-config-listener.c,v
retrieving revision 1.31
diff -u -p -r1.31 exchange-config-listener.c
--- evolution-exchange/storage/exchange-config-listener.c	28 Sep 2005 13:46:01 -0000	1.31
+++ evolution-exchange/storage/exchange-config-listener.c	1 Feb 2006 06:44:07 -0000
@@ -304,6 +304,7 @@ migrate_account_esource (EAccount *accou
 	user_name = camel_url->user;
 	authtype  = camel_url->authmech;
 	url_string = camel_url_to_string (camel_url, CAMEL_URL_HIDE_PASSWORD | CAMEL_URL_HIDE_PARAMS);
+	camel_url_free (camel_url);
 
 	if (!user_name) 
 		return;
Index: evolution/plugins/exchange-operations/exchange-permissions-dialog.c
===================================================================
RCS file: /cvs/gnome/evolution/plugins/exchange-operations/exchange-permissions-dialog.c,v
retrieving revision 1.9
diff -u -p -r1.9 exchange-permissions-dialog.c
--- evolution/plugins/exchange-operations/exchange-permissions-dialog.c	24 Aug 2005 10:10:10 -0000	1.9
+++ evolution/plugins/exchange-operations/exchange-permissions-dialog.c	1 Feb 2006 06:44:52 -0000
@@ -229,6 +229,8 @@ exchange_permissions_dialog_new (Exchang
 	lose:
 		e_error_run (GTK_WINDOW (parent), ERROR_DOMAIN ":perm-read-error", NULL);
 		gtk_widget_destroy (GTK_WIDGET (dialog));
+		if (nresults)
+			e2k_results_free (results, nresults);
 		return;
 	}
 
@@ -236,6 +238,7 @@ exchange_permissions_dialog_new (Exchang
 					    E2K_PR_EXCHANGE_SD_XML);
 	binary_form = e2k_properties_get_prop (results[0].props,
 					       E2K_PR_EXCHANGE_SD_BINARY);
+	e2k_results_free (results, nresults);
 	if (!xml_form || !binary_form)
 		goto lose;
 
Index: evolution/plugins/exchange-operations/exchange-calendar.c
===================================================================
RCS file: /cvs/gnome/evolution/plugins/exchange-operations/exchange-calendar.c,v
retrieving revision 1.14
diff -u -p -r1.14 exchange-calendar.c
--- evolution/plugins/exchange-operations/exchange-calendar.c	27 Jan 2006 12:02:57 -0000	1.14
+++ evolution/plugins/exchange-operations/exchange-calendar.c	1 Feb 2006 06:46:57 -0000
@@ -397,8 +397,10 @@ e_exchange_calendar_commit (EPlugin *epl
 	e_source_set_relative_uri (source, ruri);
 	e_source_set_property (source, "username", username);
 	e_source_set_property (source, "auth-domain", "Exchange");
-	if (authtype)
-		 e_source_set_property (source, "auth-type", authtype);
+	if (authtype) {
+		e_source_set_property (source, "auth-type", authtype);
+		g_free (authtype);
+	}
 	e_source_set_property (source, "auth", "1");
 	
 	if (!calendar_src_exists) {
Index: evolution/plugins/exchange-operations/exchange-contacts.c
===================================================================
RCS file: /cvs/gnome/evolution/plugins/exchange-operations/exchange-contacts.c,v
retrieving revision 1.14
diff -u -p -r1.14 exchange-contacts.c
--- evolution/plugins/exchange-operations/exchange-contacts.c	27 Jan 2006 12:02:57 -0000	1.14
+++ evolution/plugins/exchange-operations/exchange-contacts.c	1 Feb 2006 06:47:25 -0000
@@ -365,8 +365,10 @@ e_exchange_contacts_commit (EPlugin *epl
 	e_source_set_relative_uri (source, ruri);
 	e_source_set_property (source, "username", username);
 	e_source_set_property (source, "auth-domain", "Exchange");
-	if (authtype)
+	if (authtype) {
 		e_source_set_property (source, "auth-type", authtype);
+		g_free (authtype);
+	}
 	e_source_set_property (source, "auth", "plain/password");
 
 	if (!contacts_src_exists) {
