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

View File

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