(krb5_verify_init_creds): do not try to close an unopened ccache,

noted by <marc@mit.edu>


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9814 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
2001-04-25 05:12:37 +00:00
parent 4601e074ad
commit 869c258bcf

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997 - 2000 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997 - 2001 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -79,7 +79,7 @@ krb5_verify_init_creds(krb5_context context,
{
krb5_error_code ret;
krb5_data req;
krb5_ccache local_ccache;
krb5_ccache local_ccache = NULL;
krb5_keytab_entry entry;
krb5_creds *new_creds = NULL;
krb5_auth_context auth_context = NULL;
@@ -185,8 +185,10 @@ cleanup:
krb5_free_principal (context, server);
if (ap_req_keytab == NULL && keytab)
krb5_kt_close (context, keytab);
if (ccache == NULL
|| (ret != 0 && *ccache == NULL))
if (local_ccache != NULL
&&
(ccache == NULL
|| (ret != 0 && *ccache == NULL)))
krb5_cc_destroy (context, local_ccache);
if (ret == 0 && ccache != NULL && *ccache == NULL)