From 11352a10b4a50e02c2410dd2245bd52aec47afaf Mon Sep 17 00:00:00 2001 From: Alexandra Ellwood Date: Tue, 21 Oct 2008 21:52:29 +0000 Subject: [PATCH] kim_preferences should free old identity before overwriting ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20904 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kim/lib/kim_preferences.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/kim/lib/kim_preferences.c b/src/kim/lib/kim_preferences.c index d63a6141d..a9bd6ce55 100644 --- a/src/kim/lib/kim_preferences.c +++ b/src/kim/lib/kim_preferences.c @@ -437,16 +437,24 @@ static kim_error kim_preferences_read (kim_preferences in_preferences) if (!err) { kim_identity default_identity = kim_default_client_identity; + kim_identity identity = NULL; err = kim_os_identity_create_for_username (&default_identity); if (!err) { err = kim_os_preferences_get_identity_for_key (kim_preference_key_client_identity, default_identity, - &in_preferences->client_identity); + &identity); + } + + if (!err) { + kim_identity_free (&in_preferences->client_identity); + in_preferences->client_identity = identity; + identity = NULL; } kim_identity_free (&default_identity); + kim_identity_free (&identity); } if (!err) { -- 2.26.2