rem: if (tr->timeout.timer_list) rmv_from_timer_list( &(tr->timeout) );   shm_free(tr);
add: if ( atomic_dec_and_test( &tr->ref_cnt ) ) {  shm_free(tr); } else { LOG(L_WARN,"WARNING:destroy_transaction: transaction still " "referenceted - destroy aborted!\n"); }
context: void destroy_transaction( struct trans *tr ){	if (!tr) {		LOG(L_ERR,"ERROR:destroy_transaction: null parameter received!\n");		return;	}	/* timer */	if (tr->timeout.timer_list)		rmv_from_timer_list( &(tr->timeout) );	/* free the structure */	shm_free(tr);}