summaryrefslogtreecommitdiff
path: root/ares_destroy.c
diff options
context:
space:
mode:
authorSteinar H. Gunderson <sesse@google.com>2007-10-04 08:07:47 +0000
committerSteinar H. Gunderson <sesse@google.com>2007-10-04 08:07:47 +0000
commit4f438605ca359f408380b0235e362f8f56266edd (patch)
treed9ae8f35bc093af3be5ad0901a28e9a488db4d8a /ares_destroy.c
parent47e86f021fe189a732f643e0dfe247de24f6ea28 (diff)
downloadc-ares-4f438605ca359f408380b0235e362f8f56266edd.tar.gz
c-ares-4f438605ca359f408380b0235e362f8f56266edd.tar.bz2
c-ares-4f438605ca359f408380b0235e362f8f56266edd.zip
Moved the NULL check for channel upwards in ares_destroy().
Diffstat (limited to 'ares_destroy.c')
-rw-r--r--ares_destroy.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ares_destroy.c b/ares_destroy.c
index 1dc2d95..ef5cdb8 100644
--- a/ares_destroy.c
+++ b/ares_destroy.c
@@ -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++)
{