From: Alexandra Ellwood Date: Thu, 9 Oct 2008 02:11:51 +0000 (+0000) Subject: Crash in kim_credential_create_from_keytab X-Git-Tag: krb5-1.7-alpha1~327 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=318f8606d16fb2a904d279b89164ff58a1423dba;p=krb5.git Crash in kim_credential_create_from_keytab Was dereferencing NULL freeing creds. ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20849 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kim/lib/kim_credential.c b/src/kim/lib/kim_credential.c index ec739f98a..b4d15ab81 100644 --- a/src/kim/lib/kim_credential.c +++ b/src/kim/lib/kim_credential.c @@ -556,6 +556,7 @@ kim_error kim_credential_create_from_keytab (kim_credential *out_credential, } if (principal ) { krb5_free_principal (credential->context, principal); } + if (free_creds) { krb5_free_cred_contents (credential->context, &creds); } if (!err) { *out_credential = credential; @@ -563,7 +564,6 @@ kim_error kim_credential_create_from_keytab (kim_credential *out_credential, } if (options != in_options) { kim_options_free (&options); } - if (free_creds) { krb5_free_cred_contents (credential->context, &creds); } kim_credential_free (&credential); return check_error (err);