Skip to content

Commit

Permalink
krb5_kt_close doesn't check for NULL pointers, so we have to
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Mar 24, 2013
1 parent 09881e6 commit a37b664
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/modules/rlm_krb5/rlm_krb5.c
Expand Up @@ -390,8 +390,12 @@ static rlm_rcode_t krb5_auth(void *instance, REQUEST *request)
}

cleanup:
krb5_free_principal(context, client);
krb5_kt_close(context, keytab);
if (client) {
krb5_free_principal(context, client);
}
if (keytab) {
krb5_kt_close(context, keytab);
}
#ifdef KRB5_IS_THREAD_SAFE
krb5_free_context(context);
#endif
Expand Down Expand Up @@ -512,9 +516,15 @@ static rlm_rcode_t krb5_auth(void *instance, REQUEST *request)
cleanup:

if (context) {
krb5_free_principal(context, client);
if (client) {
krb5_free_principal(context, client);
}
if (keytab) {
krb5_kt_close(context, keytab);
}

krb5_free_cred_contents(context, &init_creds);
krb5_kt_close(context, keytab);

#ifdef KRB5_IS_THREAD_SAFE
krb5_free_context(context);
#endif
Expand Down

0 comments on commit a37b664

Please sign in to comment.