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/ChangeLog | 7 +++++++ plugins/caldav/caldav-source.c | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/caldav/ChangeLog b/plugins/caldav/ChangeLog index 777826ec40..ca3d819ecf 100644 --- a/plugins/caldav/ChangeLog +++ b/plugins/caldav/ChangeLog @@ -1,3 +1,10 @@ +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. + 2008-11-28 Milan Crha ** Part of fix for bug #359745 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