]> granicus.if.org Git - curl/commitdiff
clear the domains and sortlist when the 'channel' is first created so that
authorDaniel Stenberg <daniel@haxx.se>
Thu, 27 May 2004 07:10:02 +0000 (07:10 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 27 May 2004 07:10:02 +0000 (07:10 +0000)
we can compare if non-NULL elsewhere

ares/ares_init.c

index 19c3eb26bd46fb19d00abdc3452d8cdb5ee6249d..c0c621bd743f535425055387574099d65178cbc5 100644 (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;
     }