ares_parse_txt_reply: return a ares_txt_reply node for each sub-string
[platform/upstream/c-ares.git] / ares_destroy.c
index d921666..6c1f324 100644 (file)
@@ -1,7 +1,6 @@
-/* $Id$ */
 
 /* 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
@@ -17,8 +16,9 @@
  */
 
 #include "ares_setup.h"
+
 #include <assert.h>
-#include <stdlib.h>
+
 #include "ares.h"
 #include "ares_private.h"
 
@@ -30,10 +30,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)