From 81249965f735328c99f2899eba60db99dee92acb Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Thu, 4 Oct 2007 08:07:47 +0000 Subject: [PATCH] Moved the NULL check for channel upwards in ares_destroy(). --- ares/ares_destroy.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ares/ares_destroy.c b/ares/ares_destroy.c index 1dc2d95..ef5cdb8 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++) { -- 2.7.4