summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2012-10-30 13:56:19 -0700
committerAnas Nashif <anas.nashif@intel.com>2012-10-30 13:56:19 -0700
commit464ae771eed059267abec0875edf6f29b5fdb4e0 (patch)
treeda057bb7c64986d23b0d5027b545995a6b3f3577
parentb8e6c26b7b9608dffc84645f17fe4cf534af18dd (diff)
downloadc-ares-464ae771eed059267abec0875edf6f29b5fdb4e0.tar.gz
c-ares-464ae771eed059267abec0875edf6f29b5fdb4e0.tar.bz2
c-ares-464ae771eed059267abec0875edf6f29b5fdb4e0.zip
fix segfault in ares destroy options
-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)