rem: if (!(host_copy=pkg_malloc( via->host.len+1 ))) {
add: host_copy=pkg_malloc( via->host.len+1 ); if (!host_copy) {
context: int update_sock_struct_from_via( union sockaddr_union* to,								 struct via_body* via ){	struct hostent* he;	char *host_copy;#ifdef DNS_IP_HACK	int err;	unsigned int ip;	ip=str2ip((unsigned char*)via->host.s,via->host.len,&err);	if (err==0){		to->sin.sin_family=AF_INET;		to->sin.sin_port=(via->port)?htons(via->port): htons(SIP_PORT);		memcpy(&to->sin.sin_addr, (char*)&ip, 4);	}else#endif	{		/* we do now a malloc/memcpy because gethostbyname loves \0-terminated 		   strings; -jiri 		   but only if host is not null terminated		   (host.s[len] will always be ok for a via)           BTW: when is via->host.s non null terminated? tm copy?		   - andrei 			Yes -- it happened on generating a 408 by TM; -jiri		*/		if (via->host.s[via->host.len]){			if (!(host_copy=pkg_malloc( via->host.len+1 ))) {				LOG(L_NOTICE, "ERROR: update_sock_struct_from_via: not enough memory\n");				return -1;			}			memcpy(host_copy, via->host.s, via->host.len );			host_copy[via->host.len]=0;			he=resolvehost(host_copy);			pkg_free( host_copy );		}else{			he=resolvehost(via->host.s);		}		if (he==0){			LOG(L_NOTICE, "ERROR:forward_reply:gethostbyname(%s) failure\n",					via->host.s);			return -1;		}		hostent2su(to, he, 0, (via->port)?htons(via->port): htons(SIP_PORT));	}	return 1;}