summaryrefslogtreecommitdiff
path: root/ares_init.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-05-27 07:10:02 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-05-27 07:10:02 +0000
commit76f520955d1ffbe01ec4792f2c47a59cb5e4cbc8 (patch)
tree67922f301b128f4b16798771352f7934dce9c345 /ares_init.c
parent8cb7fd4e2223ba1893dd57fade2cf8e8d38e0bb7 (diff)
downloadc-ares-76f520955d1ffbe01ec4792f2c47a59cb5e4cbc8.tar.gz
c-ares-76f520955d1ffbe01ec4792f2c47a59cb5e4cbc8.tar.bz2
c-ares-76f520955d1ffbe01ec4792f2c47a59cb5e4cbc8.zip
clear the domains and sortlist when the 'channel' is first created so that
we can compare if non-NULL elsewhere
Diffstat (limited to 'ares_init.c')
-rw-r--r--ares_init.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ares_init.c b/ares_init.c
index 19c3eb2..c0c621b 100644
--- a/ares_init.c
+++ b/ares_init.c
@@ -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;
}