Example #1
0
void
free_EncKrbCredPart(EncKrbCredPart *data)
{
while((&(data)->ticket_info)->len){
free_KrbCredInfo(&(&(data)->ticket_info)->val[(&(data)->ticket_info)->len-1]);
(&(data)->ticket_info)->len--;
}
free((&(data)->ticket_info)->val);
(&(data)->ticket_info)->val = NULL;
if((data)->nonce) {
free((data)->nonce);
(data)->nonce = NULL;
}
if((data)->timestamp) {
free_KerberosTime((data)->timestamp);
free((data)->timestamp);
(data)->timestamp = NULL;
}
if((data)->usec) {
free((data)->usec);
(data)->usec = NULL;
}
if((data)->s_address) {
free_HostAddress((data)->s_address);
free((data)->s_address);
(data)->s_address = NULL;
}
if((data)->r_address) {
free_HostAddress((data)->r_address);
free((data)->r_address);
(data)->r_address = NULL;
}
}
Example #2
0
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
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);
	    free(auth_context->local_address);
	}
	if(auth_context->remote_address){
	    free_HostAddress(auth_context->remote_address);
	    free(auth_context->remote_address);
	}
	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;
}