diff options
author | Anas Nashif <anas.nashif@intel.com> | 2012-10-30 13:56:19 -0700 |
---|---|---|
committer | Anas Nashif <anas.nashif@intel.com> | 2012-10-30 13:56:19 -0700 |
commit | 464ae771eed059267abec0875edf6f29b5fdb4e0 (patch) | |
tree | da057bb7c64986d23b0d5027b545995a6b3f3577 | |
parent | b8e6c26b7b9608dffc84645f17fe4cf534af18dd (diff) | |
download | c-ares-464ae771eed059267abec0875edf6f29b5fdb4e0.tar.gz c-ares-464ae771eed059267abec0875edf6f29b5fdb4e0.tar.bz2 c-ares-464ae771eed059267abec0875edf6f29b5fdb4e0.zip |
fix segfault in ares destroy options
-rw-r--r-- | ares_destroy.c | 8 |
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) |