clear the domains and sortlist when the 'channel' is first created so that

we can compare if non-NULL elsewhere
This commit is contained in:
Daniel Stenberg 2004-05-27 07:10:02 +00:00
parent 5690a2b493
commit a5360255ba
1 changed files with 6 additions and 2 deletions

View File

@ -85,6 +85,8 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
channel->nsort = -1;
channel->lookups = NULL;
channel->queries = NULL;
channel->domains = NULL;
channel->sortlist = NULL;
/* Initialize configuration by each of the four sources, from highest
* precedence to lowest.
@ -464,8 +466,10 @@ DhcpNameServer
/* Handle errors. */
if (status != ARES_EOF)
{
if (servers != NULL) free(servers);
if (sortlist != NULL) free(sortlist);
if (servers != NULL)
free(servers);
if (sortlist != NULL)
free(sortlist);
return status;
}