From a5360255bad2429ca9be414a212fbaadb3b8987e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 27 May 2004 07:10:02 +0000 Subject: [PATCH] clear the domains and sortlist when the 'channel' is first created so that we can compare if non-NULL elsewhere --- ares/ares_init.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ares/ares_init.c b/ares/ares_init.c index 19c3eb26b..c0c621bd7 100644 --- a/ares/ares_init.c +++ b/ares/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; }