rem: to=(union sockaddr_union*)malloc(sizeof(union sockaddr_union));
add: to=(union sockaddr_union*)pkg_malloc(sizeof(union sockaddr_union));
context: int forward_request( struct sip_msg* msg, struct proxy_l * p, int proto){	unsigned int len;	char* buf;	union sockaddr_union* to;	struct socket_info* send_sock;	char md5[MD5_LEN];	int id; /* used as branch for tcp! */		to=0;	buf=0;	id=0;		to=(union sockaddr_union*)malloc(sizeof(union sockaddr_union));	if (to==0){		ser_error=E_OUT_OF_MEM;		LOG(L_ERR, "ERROR: forward_request: out of memory\n");		goto error;	}			/* if error try next ip address if possible */	if (p->ok==0){		if (p->host.h_addr_list[p->addr_idx+1])			p->addr_idx++;		else p->addr_idx=0;		p->ok=1;	}		hostent2su(to, &p->host, p->addr_idx, 				(p->port)?htons(p->port):htons(SIP_PORT));	p->tx++;	p->tx_bytes+=len;		send_sock=get_send_socket(to, proto);	if (send_sock==0){		LOG(L_ERR, "forward_req: ERROR: cannot forward to af %d "				"no coresponding listening socket\n", to->s.sa_family);		ser_error=E_NO_SOCKET;		goto error1;	}	/* calculate branch for outbound request;  if syn_branch is turned off,	   calculate is from transaction key, i.e., as an md5 of From/To/CallID/	   CSeq exactly the same way as TM does; good for reboot -- than messages	   belonging to transaction lost due to reboot will still be forwarded	   with the same branch parameter and will be match-able downstream       if it is turned on, we don't care about reboot; we simply put a simple	   value in there; better for performance	*/	if (syn_branch ) {		*msg->add_to_branch_s='0';		msg->add_to_branch_len=1;	} else {		if (!char_msg_val( msg, md5 )) 	{ /* parses transaction key */			LOG(L_ERR, "ERROR: forward_request: char_msg_val failed\n");			goto error1;		}		msg->hash_index=hash( msg->callid->body, get_cseq(msg)->number);		if (!branch_builder( msg->hash_index, 0, md5, id /* 0-th branch */,					msg->add_to_branch_s, &msg->add_to_branch_len )) {			LOG(L_ERR, "ERROR: forward_request: branch_builder failed\n");			goto error1;		}	}	buf = build_req_buf_from_sip_req( msg, &len, send_sock,  proto);	if (!buf){		LOG(L_ERR, "ERROR: forward_request: building failed\n");		goto error1;	}	 /* send it! */	DBG("Sending:\n%.*s.\n", (int)len, buf);	DBG("orig. len=%d, new_len=%d, proto=%d\n", msg->len, len, proto );		if (msg_send(send_sock, proto, to, 0, buf, len)<0){		ser_error=E_SEND;		p->errors++;		p->ok=0;		STATS_TX_DROPS;		goto error1;	}		/* sent requests stats */	STATS_TX_REQUEST(  msg->first_line.u.request.method_value );		pkg_free(buf);	free(to);	/* received_buf & line_buf will be freed in receive_msg by free_lump_list*/	return 0;error1:	free(to);error:	if (buf) pkg_free(buf);	return -1;}