]> granicus.if.org Git - curl/commitdiff
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/ares_destroy.c

index 1dc2d95cd292e372f260fb5ea73858d54e3b4a5b..ef5cdb8bc4325a011d4b0411c51419d8bd5e787a 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++)
       {