"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/lib/ares_parse_a_reply.c" between
c-ares-1.17.1.tar.gz and c-ares-1.17.2.tar.gz

About: c-ares is a C library for asynchronous DNS requests (including name resolves).

ares_parse_a_reply.c  (c-ares-1.17.1):ares_parse_a_reply.c  (c-ares-1.17.2)
skipping to change at line 29 skipping to change at line 29
#ifdef HAVE_NETINET_IN_H #ifdef HAVE_NETINET_IN_H
# include <netinet/in.h> # include <netinet/in.h>
#endif #endif
#ifdef HAVE_NETDB_H #ifdef HAVE_NETDB_H
# include <netdb.h> # include <netdb.h>
#endif #endif
#ifdef HAVE_ARPA_INET_H #ifdef HAVE_ARPA_INET_H
# include <arpa/inet.h> # include <arpa/inet.h>
#endif #endif
#ifdef HAVE_ARPA_NAMESER_H
# include <arpa/nameser.h> #include "ares_nameser.h"
#else
# include "nameser.h"
#endif
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
# include <arpa/nameser_compat.h>
#endif
#ifdef HAVE_STRINGS_H #ifdef HAVE_STRINGS_H
# include <strings.h> # include <strings.h>
#endif #endif
#ifdef HAVE_LIMITS_H #ifdef HAVE_LIMITS_H
# include <limits.h> # include <limits.h>
#endif #endif
#include "ares.h" #include "ares.h"
skipping to change at line 116 skipping to change at line 110
{ {
goto enomem; goto enomem;
} }
if (naliases) if (naliases)
{ {
next_cname = ai.cnames; next_cname = ai.cnames;
while (next_cname) while (next_cname)
{ {
if(next_cname->alias) if(next_cname->alias)
aliases[alias++] = strdup(next_cname->alias); aliases[alias++] = ares_strdup(next_cname->alias);
if(next_cname->ttl < cname_ttl) if(next_cname->ttl < cname_ttl)
cname_ttl = next_cname->ttl; cname_ttl = next_cname->ttl;
next_cname = next_cname->next; next_cname = next_cname->next;
} }
} }
aliases[alias] = NULL; aliases[alias] = NULL;
hostent->h_addr_list = ares_malloc((naddrs + 1) * sizeof(char *)); hostent->h_addr_list = ares_malloc((naddrs + 1) * sizeof(char *));
if (!hostent->h_addr_list) if (!hostent->h_addr_list)
skipping to change at line 138 skipping to change at line 132
goto enomem; goto enomem;
} }
for (i = 0; i < naddrs + 1; ++i) for (i = 0; i < naddrs + 1; ++i)
{ {
hostent->h_addr_list[i] = NULL; hostent->h_addr_list[i] = NULL;
} }
if (ai.cnames) if (ai.cnames)
{ {
hostent->h_name = strdup(ai.cnames->name); hostent->h_name = ares_strdup(ai.cnames->name);
ares_free(question_hostname); ares_free(question_hostname);
} }
else else
{ {
hostent->h_name = question_hostname; hostent->h_name = question_hostname;
} }
hostent->h_aliases = aliases; hostent->h_aliases = aliases;
hostent->h_addrtype = AF_INET; hostent->h_addrtype = AF_INET;
hostent->h_length = sizeof(struct in_addr); hostent->h_length = sizeof(struct in_addr);
 End of changes. 3 change blocks. 
10 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)