rem: t_check( p_msg , 0 );
add: if (t_check( p_msg , 0 )==-1) return -1;
context: int t_send_reply(  struct sip_msg* p_msg , unsigned int code , char * text ){	unsigned int len;	char * buf;	struct retrans_buff *rb;	char *b;	DBG("DEBUG: t_send_reply: entered\n");	t_check( p_msg , 0 );	if (!T)	{		LOG(L_ERR, "ERROR: t_send_reply: cannot send a t_reply to a message "			"for which no T-state has been established\n");		return -1;	}	/* if the incoming response code is not reliable->drop it*/	/*	if ( !t_should_relay_response( T , code ) )		return 1;	*/	rb = & T->outbound_response;	if (!rb->retr_buffer) {		/* initialize retransmission structure */		memset( rb , 0 , sizeof (struct retrans_buff) );		if (update_sock_struct_from_via(  &(rb->to),  p_msg->via1 )==-1)		{			LOG(L_ERR, "ERROR: t_send_reply: cannot lookup reply dst: %s\n",				p_msg->via1->host.s );			goto error;		}		rb->retr_timer.payload = rb;		rb->fr_timer.payload = rb;		rb->to.sin_family = AF_INET;		rb->my_T = T;	}	buf = build_res_buf_from_sip_req( code , text , T->inbound_request , &len );	DBG("DEBUG: t_send_reply: buffer computed\n");	if (!buf)	{		DBG("DEBUG: t_send_reply: response building failed\n");		goto error;	}	if (! (b = (char*)sh_malloc( len )))	{		LOG(L_ERR, "ERROR: t_send_reply: cannot allocate shmem buffer\n");		goto error2;	}	/* if present, remove previous message */	if (  rb->retr_buffer)		sh_free( rb->retr_buffer );	rb->retr_buffer   = b;	rb->bufflen = len ;	memcpy( rb->retr_buffer , buf , len );	free( buf ) ;	T->status = code;	/* start/stops the proper timers*/	DBG("DEBUG: t_send_reply: update timers\n");	t_update_timers_after_sending_reply( rb );	DBG("DEBUG: t_send_reply: send reply\n");	/* t_retransmit_reply( p_msg, 0 , 0); */	SEND_BUFFER( rb );	return 1;error2:	free ( buf );error:	return -1;}