diff options
| author | Chenthill Palanisamy <pchen@src.gnome.org> | 2007-07-30 10:10:18 +0000 |
|---|---|---|
| committer | Chenthill Palanisamy <pchen@src.gnome.org> | 2007-07-30 10:10:18 +0000 |
| commit | 49d227885e9253391ea916890979e68c8f4294a2 (patch) | |
| tree | 501d662cb34149d7c72fdada91019af84e7eed4b | |
| parent | f33bb2595efcc5fdb2a63a8ebbe6cea66f0c5089 (diff) | |
| download | evolution-data-server-49d227885e9253391ea916890979e68c8f4294a2.tar.gz | |
Fixes a memory corruption.
svn path=/trunk/; revision=7896
| -rw-r--r-- | calendar/ChangeLog | 5 | ||||
| -rw-r--r-- | calendar/libecal/e-cal.c | 17 |
2 files changed, 14 insertions, 8 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index ce1f5b3f7..72afb3cbc 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,8 @@ +2007-07-30 Chenthill Palanisamy <pchenthill@novell.com> + + Fixes a memory corruption. + * libecal/e-cal.c: (open_calendar): Use e_source_get_duped_property. + 2007-07-13 Milan Crha <mcrha@redhat.com> ** Fix for bug #456565 diff --git a/calendar/libecal/e-cal.c b/calendar/libecal/e-cal.c index 9ea6e8529..d2cb190c8 100644 --- a/calendar/libecal/e-cal.c +++ b/calendar/libecal/e-cal.c @@ -1702,8 +1702,7 @@ open_calendar (ECal *ecal, gboolean only_if_exists, GError **error, ECalendarSta ECalPrivate *priv; CORBA_Environment ev; ECalendarOp *our_op; - const char *username = NULL, *auth_type = NULL; - char *password = NULL; + char *username = NULL, *auth_type = NULL, *password = NULL; gboolean read_only = FALSE; e_return_error_if_fail (ecal != NULL, E_CALENDAR_STATUS_INVALID_ARG); @@ -1732,7 +1731,7 @@ open_calendar (ECal *ecal, gboolean only_if_exists, GError **error, ECalendarSta /* see if the backend needs authentication */ if ( (priv->mode != CAL_MODE_LOCAL) && e_source_get_property (priv->source, "auth")) { char *prompt, *key; - const char *parent_user; + char *parent_user; priv->load_state = E_CAL_LOAD_AUTHENTICATING; @@ -1745,7 +1744,7 @@ open_calendar (ECal *ecal, gboolean only_if_exists, GError **error, ECalendarSta E_CALENDAR_CHECK_STATUS (E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED, error); } - username = e_source_get_property (priv->source, "username"); + username = e_source_get_duped_property (priv->source, "username"); if (!username) { e_calendar_remove_op (ecal, our_op); g_mutex_unlock (our_op->mutex); @@ -1758,11 +1757,11 @@ open_calendar (ECal *ecal, gboolean only_if_exists, GError **error, ECalendarSta prompt = g_strdup_printf (_("Enter password for %s (user %s)"), e_source_peek_name (priv->source), username); - auth_type = e_source_get_property (priv->source, "auth-type"); + auth_type = e_source_get_duped_property (priv->source, "auth-type"); if (auth_type) key = build_pass_key (ecal); else { - parent_user = e_source_get_property (priv->source, "parent_id_name"); + parent_user = e_source_get_duped_property (priv->source, "parent_id_name"); if (parent_user) { key = build_proxy_pass_key (ecal, parent_user); /* @@ -1770,9 +1769,11 @@ open_calendar (ECal *ecal, gboolean only_if_exists, GError **error, ECalendarSta the auth_func corresponds to the parent user. */ prompt = g_strdup_printf (_("Enter password for %s to enable proxy for user %s"), e_source_peek_name (priv->source), parent_user); + g_free (parent_user); } else key = g_strdup (e_cal_get_uri (ecal)); } + g_free (auth_type); if (!key) { e_calendar_remove_op (ecal, our_op); @@ -1807,8 +1808,8 @@ open_calendar (ECal *ecal, gboolean only_if_exists, GError **error, ECalendarSta username ? username : "", password ? password : "", &ev); - if (password) - g_free (password); + g_free (password); + g_free (username); if (BONOBO_EX (&ev)) { e_calendar_remove_op (ecal, our_op); |
