summaryrefslogtreecommitdiff
path: root/ares_destroy.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2011-08-21 16:41:43 +0200
committerYang Tse <yangsita@gmail.com>2011-08-21 16:42:44 +0200
commitb816675c0f1dddfbff5fb1edc99ee484ccf4c1b6 (patch)
tree50a04911b25faff20635f824e7bf087c96fa9ea7 /ares_destroy.c
parentd0c3cb6840e4b8e22b2fa4a944fe514992fd4aa4 (diff)
downloadc-ares-b816675c0f1dddfbff5fb1edc99ee484ccf4c1b6.tar.gz
c-ares-b816675c0f1dddfbff5fb1edc99ee484ccf4c1b6.tar.bz2
c-ares-b816675c0f1dddfbff5fb1edc99ee484ccf4c1b6.zip
ares_destroy.c: fix segfault in ares_destroy_options()
Diffstat (limited to 'ares_destroy.c')
-rw-r--r--ares_destroy.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ares_destroy.c b/ares_destroy.c
index 5e274da..a3f6ea2 100644
--- a/ares_destroy.c
+++ b/ares_destroy.c
@@ -1,6 +1,6 @@
/* Copyright 1998 by the Massachusetts Institute of Technology.
- * Copyright (C) 2004-2010 by Daniel Stenberg
+ * Copyright (C) 2004-2011 by Daniel Stenberg
*
* Permission to use, copy, modify, and distribute this
* software and its documentation for any purpose and without
@@ -29,10 +29,12 @@ void ares_destroy_options(struct ares_options *options)
free(options->servers);
for (i = 0; i < options->ndomains; i++)
free(options->domains[i]);
- free(options->domains);
+ if(options->domains)
+ free(options->domains);
if(options->sortlist)
free(options->sortlist);
- free(options->lookups);
+ if(options->lookups)
+ free(options->lookups);
}
void ares_destroy(ares_channel channel)