Index: plugins/caldav/ChangeLog
===================================================================
--- plugins/caldav/ChangeLog	(revision 36277)
+++ plugins/caldav/ChangeLog	(working copy)
@@ -1,3 +1,10 @@
+2008-09-08  Milan Crha  <mcrha@redhat.com>
+
+	** Part of fix for bug #503662
+
+	* caldav-source.c: (user_changed):
+	Set NULL properly to protect against using already freed memory.
+
 2008-09-02  Sankar P  <psankar@novell.com>
 
 License Changes
Index: plugins/caldav/caldav-source.c
===================================================================
--- plugins/caldav/caldav-source.c	(revision 36277)
+++ plugins/caldav/caldav-source.c	(working copy)
@@ -175,11 +175,12 @@ user_changed (GtkEntry *editable, ESourc
 	euri = e_uri_new (uri);
 	g_free (euri->user);
 
-	if (user != NULL) {
+	if (user != NULL && *user) {
 		euri->user = g_strdup (user);
 		e_source_set_property (source, "auth", "1");
 	} else {
 		e_source_set_property (source, "auth", NULL);
+		euri->user = NULL;
 	}
 
 	e_source_set_property (source, "username", euri->user);
