Moved the NULL check for channel upwards in ares_destroy().
authorSteinar H. Gunderson <sesse@google.com>
Thu, 4 Oct 2007 08:07:47 +0000 (08:07 +0000)
committerSteinar H. Gunderson <sesse@google.com>
Thu, 4 Oct 2007 08:07:47 +0000 (08:07 +0000)
ares_destroy.c

index 1dc2d95..ef5cdb8 100644 (file)
@@ -40,6 +40,9 @@ void ares_destroy(ares_channel channel)
   struct query *query;
   struct list_node* list_head;
   struct list_node* list_node;
+  
+  if (!channel)
+    return;
 
   list_head = &(channel->all_queries);
   for (list_node = list_head->next; list_node != list_head; )
@@ -64,9 +67,6 @@ void ares_destroy(ares_channel channel)
     }
 #endif
 
-  if (!channel)
-    return;
-
   if (channel->servers) {
     for (i = 0; i < channel->nservers; i++)
       {