From c3bf6cb846d9fbc5751639ef698c29adaea32165 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 28 Nov 2008 12:20:23 +0000 Subject: ** Part of fix for bug #503662 2008-11-28 Milan Crha ** Part of fix for bug #503662 * caldav-source.c: (user_changed): Set NULL properly to protect against using already freed memory. svn path=/trunk/; revision=36821 --- plugins/caldav/caldav-source.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins/caldav/caldav-source.c') diff --git a/plugins/caldav/caldav-source.c b/plugins/caldav/caldav-source.c index cd758f54bb..81e5b0fdd9 100644 --- a/plugins/caldav/caldav-source.c +++ b/plugins/caldav/caldav-source.c @@ -191,11 +191,12 @@ user_changed (GtkEntry *editable, ESource *source) 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); -- cgit v1.2.3