(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). * (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved. * All rights reserved.
* *
@@ -67,20 +67,21 @@ krb5_error_code
krb5_auth_con_free(krb5_context context, krb5_auth_con_free(krb5_context context,
krb5_auth_context auth_context) krb5_auth_context auth_context)
{ {
krb5_free_authenticator(context, &auth_context->authenticator); if (auth_context != NULL) {
if(auth_context->local_address){ krb5_free_authenticator(context, &auth_context->authenticator);
free_HostAddress(auth_context->local_address); if(auth_context->local_address){
free(auth_context->local_address); free_HostAddress(auth_context->local_address);
} free(auth_context->local_address);
if(auth_context->remote_address){ }
free_HostAddress(auth_context->remote_address); if(auth_context->remote_address){
free(auth_context->remote_address); 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->keyblock);
krb5_free_keyblock(context, auth_context->remote_subkey); krb5_free_keyblock(context, auth_context->remote_subkey);
krb5_free_keyblock(context, auth_context->local_subkey); krb5_free_keyblock(context, auth_context->local_subkey);
free (auth_context); free (auth_context);
}
return 0; return 0;
} }