rem: if (addr) free(addr);
context: int udp_init(struct socket_info* sock_info){	union sockaddr_union* addr;	int sock_len;	int optval;	addr=(union sockaddr_union*)malloc(sizeof(union sockaddr_union));	if (addr==0){		LOG(L_ERR, "ERROR: udp_init: out of memory\n");		goto error;	}		if (init_su(addr, &sock_info->address, htons(sock_info->port_no))<0){		LOG(L_ERR, "ERROR: udp_init: could not init sockaddr_union\n");		goto error;	}	/*	addr->sin_family=AF_INET;	addr->sin_port=htons(port);	addr->sin_addr.s_addr=ip;	*/		sock_info->socket = socket(AF2PF(addr->s.sa_family), SOCK_DGRAM, 0);	if (sock_info->socket==-1){		LOG(L_ERR, "ERROR: udp_init: socket: %s\n", strerror(errno));		goto error;	}	/* set sock opts? */	optval=1;	if (setsockopt(sock_info->socket, SOL_SOCKET, SO_REUSEADDR ,					(void*)&optval, sizeof(optval)) ==-1){		LOG(L_ERR, "ERROR: udp_init: setsockopt: %s\n", strerror(errno));		goto error;	}#if defined (__linux__) && defined(UDP_ERRORS)	optval=1;	/* enable error receiving on unconnected sockets */	if(setsockopt(sock_info->socket, SOL_IP, IP_RECVERR,					(void*)&optval, sizeof(optval)) ==-1){		LOG(L_ERR, "ERROR: udp_init: setsockopt: %s\n", strerror(errno));		goto error;	}#endif	if ( probe_max_receive_buffer(sock_info->socket)==-1) goto error;#ifdef __FreeBSD__	sock_len=addr->s.sa_len;#else	sock_len=sizeof(union sockaddr_union);#endif		if (bind(sock_info->socket,  &addr->s, sock_len)==-1){		LOG(L_ERR, "ERROR: udp_init: bind(%x, %p, %d) on %s: %s\n",				sock_info->socket, &addr->s, 				sock_len,				sock_info->address_str.s,				strerror(errno));	#ifdef USE_IPV6		if (addr->s.sa_family==AF_INET6)			LOG(L_ERR, "ERROR: udp_init: might be caused by using a link "					" local address, try site local or global\n");	#endif		goto error;	}	free(addr);	return 0;error:	if (addr) free(addr);	return -1;}