From: Alexandra Ellwood Date: Tue, 21 Oct 2008 21:52:29 +0000 (+0000) Subject: kim_preferences should free old identity before overwriting X-Git-Tag: krb5-1.7-alpha1~279 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=11352a10b4a50e02c2410dd2245bd52aec47afaf;p=krb5.git 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 --- 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) {