FreeBSD/contrib/openbsm/libbsm/bsm_audit.c
/*
 * Given a record that is no longer of interest, tear it down and convert to a
 * free record.
 */
Given a record that is no longer of interest, tear it down and convert to a
free record.
Given a record that is no longer of interest tear it down and convert to a free record .
static void
au_teardown(au_record_t *rec)
{
	token_t *tok;
	while ((tok = TAILQ_FIRST(&rec->token_q)) != NULL) {
		TAILQ_REMOVE(&rec->token_q, tok, tokens);
		free(tok->t_data);
		free(tok);
	}
	rec->used = 0;
	rec->len = 0;
#ifdef HAVE_PTHREAD_MUTEX_LOCK
	pthread_mutex_lock(&mutex);
#endif
	LIST_INSERT_HEAD(&audit_free_q, rec, au_rec_q);
#ifdef HAVE_PTHREAD_MUTEX_LOCK
	pthread_mutex_unlock(&mutex);
#endif
}
static void au_teardown ( au_record_t * rec ) { token_t * tok ; while ( ( tok = TAILQ_FIRST ( & rec -> token_q ) ) != NULL ) { TAILQ_REMOVE ( & rec -> token_q , tok , tokens ) ; free ( tok -> t_data ) ; free ( tok ) ; } rec -> used = 0 ; rec -> len = 0 ; #ifdef HAVE_PTHREAD_MUTEX_LOCK pthread_mutex_lock ( & mutex ) ; #endif LIST_INSERT_HEAD ( & audit_free_q , rec , au_rec_q ) ; #ifdef HAVE_PTHREAD_MUTEX_LOCK pthread_mutex_unlock ( & mutex ) ; #endif }
Given a record that is no longer of interest, tear it down and convert to a
 free record.
Given a record that is no longer of interest tear it down and convert to a free record .
/* Free the token list */ /* Add the record to the freelist tail */