summaryrefslogtreecommitdiff
path: root/ares_destroy.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2007-05-30 20:49:14 +0000
committerDaniel Stenberg <daniel@haxx.se>2007-05-30 20:49:14 +0000
commitf1440b240528afe3dfc03256d92b49acb4ef8537 (patch)
tree209faa808cec296a6d2398c0160449972c4e5de8 /ares_destroy.c
parent8c35c65fc7c746d5803a48151e82e0435c20a84c (diff)
downloadc-ares-f1440b240528afe3dfc03256d92b49acb4ef8537.tar.gz
c-ares-f1440b240528afe3dfc03256d92b49acb4ef8537.tar.bz2
c-ares-f1440b240528afe3dfc03256d92b49acb4ef8537.zip
Brad House added ares_save_options() and ares_destroy_options() that can be
used to keep options for later re-usal when ares_init_options() is used.
Diffstat (limited to 'ares_destroy.c')
-rw-r--r--ares_destroy.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/ares_destroy.c b/ares_destroy.c
index fd243c3..8d9bdbc 100644
--- a/ares_destroy.c
+++ b/ares_destroy.c
@@ -20,6 +20,19 @@
#include "ares.h"
#include "ares_private.h"
+void ares_destroy_options(struct ares_options *options)
+{
+ int i;
+
+ free(options->servers);
+ for (i = 0; i < options->ndomains; i++)
+ free(options->domains[i]);
+ free(options->domains);
+ if(options->sortlist)
+ free(options->sortlist);
+ free(options->lookups);
+}
+
void ares_destroy(ares_channel channel)
{
int i;