From: Steinar H. Gunderson Date: Thu, 4 Oct 2007 08:07:47 +0000 (+0000) Subject: Moved the NULL check for channel upwards in ares_destroy(). X-Git-Tag: curl-7_17_1~114 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81249965f735328c99f2899eba60db99dee92acb;p=thirdparty%2Fcurl.git Moved the NULL check for channel upwards in ares_destroy(). --- diff --git a/ares/ares_destroy.c b/ares/ares_destroy.c index 1dc2d95cd2..ef5cdb8bc4 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++) {