(krb5_auth_con_free): handle auth_context == NULL

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8994 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
2000-08-26 11:43:30 +00:00
parent d1629f48e3
commit e81dac9b62

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 1998, 1999 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997 - 2000 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -67,6 +67,7 @@ krb5_error_code
krb5_auth_con_free(krb5_context context,
krb5_auth_context auth_context)
{
if (auth_context != NULL) {
krb5_free_authenticator(context, &auth_context->authenticator);
if(auth_context->local_address){
free_HostAddress(auth_context->local_address);
@@ -76,11 +77,11 @@ krb5_auth_con_free(krb5_context context,
free_HostAddress(auth_context->remote_address);
free(auth_context->remote_address);
}
if(auth_context->keyblock)
krb5_free_keyblock(context, auth_context->keyblock);
krb5_free_keyblock(context, auth_context->remote_subkey);
krb5_free_keyblock(context, auth_context->local_subkey);
free (auth_context);
}
return 0;
}