Index: calendar/gui/dialogs/task-page.c
===================================================================
--- calendar/gui/dialogs/task-page.c	(revision 34086)
+++ calendar/gui/dialogs/task-page.c	(working copy)
@@ -257,7 +257,10 @@
 
 	if (priv->comp != NULL)
 		g_object_unref (priv->comp);
- 
+
+ 	g_free (priv->default_address);
+	priv->default_address = NULL;
+
 	cleanup_attendees (priv->deleted_attendees);
 	g_ptr_array_free (priv->deleted_attendees, TRUE);
 
@@ -343,7 +346,8 @@
 	/* Categories */
 	e_dialog_editable_set (priv->categories, NULL);
 	
-	gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (priv->organizer)->entry), priv->default_address);
+	if (priv->default_address)
+		gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (priv->organizer)->entry), priv->default_address);
 	
 }
 
@@ -1918,6 +1922,11 @@
 		gchar *full = NULL;
 		
 		a = (EAccount *)e_iterator_get(it);
+
+		/* skip disabled accounts */
+		if (!a->enabled)
+			continue;
+
 		full = g_strdup_printf("%s <%s>", a->id->name, a->id->address);
 
 		/* Note that the address specified by the backend gets
@@ -1930,6 +1939,10 @@
 			priv->default_address = full;
 		} else if (a == def_account && !priv->default_address)
 			priv->default_address = full;
+		else if (!priv->default_address)
+			priv->default_address = full;
+		else
+			g_free (full);
 	}
 	g_object_unref(it);
 
@@ -1968,7 +1981,6 @@
 	TaskPagePrivate *priv;
 	char *backend_address = NULL;
 	EIterator *it;
-	EAccount *def_account;
 	GList *address_strings = NULL, *l;
 	EAccount *a;
 	char *gladefile;
@@ -2000,16 +2012,13 @@
 		return NULL;
 
 	priv->accounts = itip_addresses_get ();
-	def_account = itip_addresses_get_default();
 	for (it = e_list_get_iterator((EList *)priv->accounts);
 	     e_iterator_is_valid(it);
 	     e_iterator_next(it)) {
-		gchar *full = NULL;
-		
 		a = (EAccount *)e_iterator_get(it);
-		full = g_strdup_printf("%s <%s>", a->id->name, a->id->address);
 
-		address_strings = g_list_append(address_strings, full);
+		if (a->enabled)
+			address_strings = g_list_append (address_strings, g_strdup_printf ("%s <%s>", a->id->name, a->id->address));
 	}
 	
 	task_page_select_organizer (tpage, backend_address);
Index: calendar/gui/dialogs/event-page.c
===================================================================
--- calendar/gui/dialogs/event-page.c	(revision 34086)
+++ calendar/gui/dialogs/event-page.c	(working copy)
@@ -3172,6 +3172,11 @@
 		gchar *full = NULL;
 		
 		a = (EAccount *)e_iterator_get(it);
+
+		/* skip disabled accounts */
+		if (!a->enabled)
+			continue;
+
 		full = g_strdup_printf("%s <%s>", a->id->name, a->id->address);
 
 		/* Note that the address specified by the backend gets
@@ -3184,6 +3189,8 @@
 			priv->default_address = full;
 		} else if (a == def_account && !priv->default_address) 
 			priv->default_address = full;
+		else if (!priv->default_address)
+			priv->default_address = full;
 		else
 			g_free (full);
 	}
@@ -3216,7 +3223,6 @@
 {
 	EventPagePrivate *priv;
 	EIterator *it;
-	EAccount *def_account;
 	GList *address_strings = NULL, *l;
 	EAccount *a;
 	char *gladefile;
@@ -3245,16 +3251,13 @@
 	}
 
 	priv->accounts = itip_addresses_get ();
-	def_account = itip_addresses_get_default();
 	for (it = e_list_get_iterator((EList *)priv->accounts);
 	     e_iterator_is_valid(it);
 	     e_iterator_next(it)) {
-		gchar *full = NULL;
-		
 		a = (EAccount *)e_iterator_get(it);
-		full = g_strdup_printf("%s <%s>", a->id->name, a->id->address);
 
-		address_strings = g_list_append(address_strings, full);
+		if (a->enabled)
+			address_strings = g_list_append (address_strings, g_strdup_printf("%s <%s>", a->id->name, a->id->address));
 	}
 	
 	g_object_unref(it);
Index: calendar/ChangeLog
===================================================================
--- calendar/ChangeLog	(revision 34086)
+++ calendar/ChangeLog	(working copy)
@@ -1,3 +1,18 @@
+2007-08-24  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #270605
+
+	* gui/dialogs/task-page.c: (task_page_construct):
+	* gui/dialogs/event-page.c: (event_page_construct):
+	Removed unused variable and add only enabled accounts into the list.
+	* gui/dialogs/task-page.c: (task_page_select_organizer):
+	* gui/dialogs/event-page.c: (event_page_select_organizer):
+	Skip disabled accounts and choose first available address as organizer.
+
+	* gui/dialogs/task-page.c: (task_page_select_organizer),
+	(task_page_finalize), (clear_widgets):
+	Fixed memory leak and critical warning when default_address is NULL.
+
 2007-08-24  Hiroyuki Ikezoe  <poincare@ikezoe.net>
 
 	** Fix for bug #330628
