(digest_request): if NULL is passed in as realm, use default realm.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18197 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -247,7 +247,8 @@ digest_request(krb5_context context,
|
||||
krb5_crypto crypto = NULL;
|
||||
krb5_auth_context ac = NULL;
|
||||
krb5_principal principal = NULL;
|
||||
krb5_ccache id;
|
||||
krb5_ccache id = NULL;
|
||||
krb5_realm r = NULL;
|
||||
|
||||
krb5_data_zero(&data);
|
||||
krb5_data_zero(&data2);
|
||||
@@ -259,6 +260,13 @@ digest_request(krb5_context context,
|
||||
} else
|
||||
id = ccache;
|
||||
|
||||
if (realm == NULL) {
|
||||
ret = krb5_get_default_realm(context, &r);
|
||||
if (ret)
|
||||
goto out;
|
||||
} else
|
||||
r = realm;
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
@@ -373,8 +381,10 @@ digest_request(krb5_context context,
|
||||
}
|
||||
|
||||
out:
|
||||
if (ccache == NULL)
|
||||
if (ccache == NULL && id)
|
||||
krb5_cc_close(context, id);
|
||||
if (realm == NULL && r)
|
||||
free(r);
|
||||
if (crypto)
|
||||
krb5_crypto_destroy(context, crypto);
|
||||
if (ac)
|
||||
|
Reference in New Issue
Block a user