Commit ee374e53 authored by Simon Morlat's avatar Simon Morlat

use belle_sip_freeaddrinfo() to be consistent.

parent 84991383
......@@ -64,7 +64,7 @@ static void belle_sip_dns_srv_destroy(belle_sip_dns_srv_t *obj){
obj->a_resolver=NULL;
}
if (obj->a_results){
freeaddrinfo(obj->a_results);
belle_sip_freeaddrinfo(obj->a_results);
obj->a_results=NULL;
}
}
......@@ -617,7 +617,7 @@ static void belle_sip_combined_resolver_context_destroy(belle_sip_combined_resol
}
static void belle_sip_simple_resolver_context_destroy(belle_sip_simple_resolver_context_t *ctx){
/* Do not free elements of ctx->ai_list with freeaddrinfo(). Let the caller do it, otherwise
/* Do not free elements of ctx->ai_list with belle_sip_freeaddrinfo(). Let the caller do it, otherwise
it will not be able to use them after the resolver has been destroyed. */
if (ctx->name != NULL) {
belle_sip_free(ctx->name);
......@@ -647,11 +647,11 @@ static void belle_sip_dual_resolver_context_destroy(belle_sip_dual_resolver_cont
obj->aaaa_ctx=NULL;
}
if (obj->a_results){
freeaddrinfo(obj->a_results);
belle_sip_freeaddrinfo(obj->a_results);
obj->a_results=NULL;
}
if (obj->aaaa_results){
freeaddrinfo(obj->aaaa_results);
belle_sip_freeaddrinfo(obj->aaaa_results);
obj->aaaa_results=NULL;
}
if (obj->name){
......@@ -1004,7 +1004,7 @@ fail:
if (res != NULL) {
memcpy(src,res->ai_addr,MIN((size_t)*srclen,res->ai_addrlen));
*srclen=res->ai_addrlen;
freeaddrinfo(res);
belle_sip_freeaddrinfo(res);
} else {
belle_sip_fatal("belle_sip_get_src_addr_for(): belle_sip_ip_address_to_addrinfo() failed");
}
......
......@@ -68,7 +68,7 @@ static belle_sip_list_t * for_each_weak_unref_free(belle_sip_list_t *l, belle_si
}
static void belle_sip_channel_destroy(belle_sip_channel_t *obj){
if (obj->peer_list) freeaddrinfo(obj->peer_list);
if (obj->peer_list) belle_sip_freeaddrinfo(obj->peer_list);
if (obj->peer_cname) belle_sip_free(obj->peer_cname);
belle_sip_free(obj->peer_name);
if (obj->local_ip) belle_sip_free(obj->local_ip);
......@@ -646,7 +646,7 @@ void belle_sip_channel_init(belle_sip_channel_t *obj, belle_sip_stack_t *stack,c
if (peername){
/*check if we are given a real dns name or just an ip address*/
struct addrinfo *ai=belle_sip_ip_address_to_addrinfo(AF_UNSPEC,peername,peer_port);
if (ai) freeaddrinfo(ai);
if (ai) belle_sip_freeaddrinfo(ai);
else obj->has_name=TRUE;
}
belle_sip_channel_input_stream_reset(&obj->input_stream);
......@@ -1308,7 +1308,7 @@ belle_sip_channel_t *belle_sip_channel_find_from_list(belle_sip_list_t *l, int a
belle_sip_getaddrinfo(hop->host,portstr,&hints,&res);
chan=belle_sip_channel_find_from_list_with_addrinfo(l,hop,res);
if (res) freeaddrinfo(res);
if (res) belle_sip_freeaddrinfo(res);
return chan;
}
......
......@@ -218,6 +218,7 @@ struct addrinfo *convert_to_v4mapped(const struct addrinfo *ai){
struct sockaddr_in6 *sin6;
struct sockaddr_in *sin;
v4m=_belle_sip_alloc_addrinfo(AF_INET6, it->ai_socktype, it->ai_protocol);
v4m->ai_flags|=AI_V4MAPPED;
sin6=(struct sockaddr_in6*)v4m->ai_addr;
sin=(struct sockaddr_in*)it->ai_addr;
sin6->sin6_family=AF_INET6;
......
......@@ -77,7 +77,7 @@ static void reset_endpoint(endpoint_t *endpoint) {
endpoint->resolve_done = 0;
endpoint->resolve_ko = 0;
if (endpoint->ai_list != NULL) {
freeaddrinfo(endpoint->ai_list);
belle_sip_freeaddrinfo(endpoint->ai_list);
endpoint->ai_list = NULL;
}
if (endpoint->srv_list != NULL) {
......@@ -133,7 +133,7 @@ static void ipv4_a_query(void) {
ai = belle_sip_ip_address_to_addrinfo(AF_INET, IPV4_SIP_IP, SIP_PORT);
if (ai) {
CU_ASSERT_EQUAL(sock_in->sin_addr.s_addr, ((struct sockaddr_in *)ai->ai_addr)->sin_addr.s_addr);
freeaddrinfo(ai);
belle_sip_freeaddrinfo(ai);
}
}
......@@ -159,7 +159,7 @@ static void ipv4_cname_a_query(void) {
ai = belle_sip_ip_address_to_addrinfo(AF_INET, IPV4_CNAME_IP, SIP_PORT);
if (ai) {
CU_ASSERT_EQUAL(sock_in->sin_addr.s_addr, ((struct sockaddr_in *)ai->ai_addr)->sin_addr.s_addr);
freeaddrinfo(ai);
belle_sip_freeaddrinfo(ai);
}
}
......@@ -300,7 +300,7 @@ static void ipv6_aaaa_query(void) {
for (i = 0; i < 8; i++) {
CU_ASSERT_EQUAL(sock_in6->sin6_addr.s6_addr[i], ipv6_address->s6_addr[i]);
}
freeaddrinfo(ai);
belle_sip_freeaddrinfo(ai);
}
next=client->ai_list->ai_next;
CU_ASSERT_PTR_NOT_NULL(next);
......@@ -317,7 +317,7 @@ static void ipv6_aaaa_query(void) {
for (i = 0; i < 8; i++) {
CU_ASSERT_EQUAL(sock_in6->sin6_addr.s6_addr[i], ipv6_address->s6_addr[i]);
}
freeaddrinfo(ai);
belle_sip_freeaddrinfo(ai);
}
}
}
......@@ -377,7 +377,7 @@ static void srv_a_query_no_srv_result(void) {
ai = belle_sip_ip_address_to_addrinfo(AF_INET, IPV4_SIP_IP, SIP_PORT);
if (ai) {
CU_ASSERT_EQUAL(sock_in->sin_addr.s_addr, ((struct sockaddr_in *)ai->ai_addr)->sin_addr.s_addr);
freeaddrinfo(ai);
belle_sip_freeaddrinfo(ai);
}
}
......@@ -417,7 +417,7 @@ static void no_query_needed(void) {
ai = belle_sip_ip_address_to_addrinfo(AF_INET, IPV4_SIP_IP, SIP_PORT);
if (ai) {
CU_ASSERT_EQUAL(sock_in->sin_addr.s_addr, ((struct sockaddr_in *)ai->ai_addr)->sin_addr.s_addr);
freeaddrinfo(ai);
belle_sip_freeaddrinfo(ai);
}
}
......@@ -462,7 +462,7 @@ static void dns_fallback(void) {
ai = belle_sip_ip_address_to_addrinfo(AF_INET, IPV4_SIP_IP, SIP_PORT);
if (ai) {
CU_ASSERT_EQUAL(sock_in->sin_addr.s_addr, ((struct sockaddr_in *)ai->ai_addr)->sin_addr.s_addr);
freeaddrinfo(ai);
belle_sip_freeaddrinfo(ai);
}
}
......@@ -497,7 +497,7 @@ static void ipv6_dns_server(void) {
ai = belle_sip_ip_address_to_addrinfo(AF_INET, IPV4_SIP_IP, SIP_PORT);
if (ai) {
CU_ASSERT_EQUAL(sock_in->sin_addr.s_addr, ((struct sockaddr_in *)ai->ai_addr)->sin_addr.s_addr);
freeaddrinfo(ai);
belle_sip_freeaddrinfo(ai);
}
}
......@@ -532,7 +532,7 @@ static void ipv4_and_ipv6_dns_server(void) {
ai = belle_sip_ip_address_to_addrinfo(AF_INET, IPV4_SIP_IP, SIP_PORT);
if (ai) {
CU_ASSERT_EQUAL(sock_in->sin_addr.s_addr, ((struct sockaddr_in *)ai->ai_addr)->sin_addr.s_addr);
freeaddrinfo(ai);
belle_sip_freeaddrinfo(ai);
}
}
......
......@@ -111,7 +111,7 @@ static int _belle_sip_tester_ipv6_available(void){
src.ai_addr=(struct sockaddr*) &ss;
src.ai_addrlen=slen;
belle_sip_addrinfo_to_ip(&src,localip, sizeof(localip),&port);
freeaddrinfo(ai);
belle_sip_freeaddrinfo(ai);
return strcmp(localip,"::1")!=0;
}
return FALSE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment