aboutsummaryrefslogtreecommitdiff
path: root/ares/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
commit81249965f735328c99f2899eba60db99dee92acb (patch)
treeea6762e220fea0988e8d70a6a437dda96f8cca65 /ares/ares_destroy.c
parent45c6db9ac43f74ebc01edb2efbfb014df4f8783e (diff)
Moved the NULL check for channel upwards in ares_destroy().
Diffstat (limited to 'ares/ares_destroy.c')
-rw-r--r--ares/ares_destroy.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ares/ares_destroy.c b/ares/ares_destroy.c
index 1dc2d95cd..ef5cdb8bc 100644
--- a/ares/ares_destroy.c
+++ b/ares/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++)
{