Crash in kim_credential_create_from_keytab
authorAlexandra Ellwood <lxs@mit.edu>
Thu, 9 Oct 2008 02:11:51 +0000 (02:11 +0000)
committerAlexandra Ellwood <lxs@mit.edu>
Thu, 9 Oct 2008 02:11:51 +0000 (02:11 +0000)
Was dereferencing NULL freeing creds.

ticket: new

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20849 dc483132-0cff-0310-8789-dd5450dbe970

src/kim/lib/kim_credential.c

index ec739f98a90d8253db313b9b76cb566d432ce249..b4d15ab8160ebf9a4315d9b81e046e93ba0b0225 100644 (file)
@@ -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);