changeset 1665:3e804040cb31

complete a_Dns_freeall() This is an attempt to make valgrind a little bit happier.
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Sun, 25 Apr 2010 23:33:58 +0200
parents 9e081321c25b
children 6beaa7ebc4a8
files src/dns.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/dns.c	Sat Apr 24 23:16:44 2010 +0200
+++ b/src/dns.c	Sun Apr 25 23:33:58 2010 +0200
@@ -487,10 +487,13 @@
  */
 void a_Dns_freeall(void)
 {
-   int i;
+   int i, j;
 
    for ( i = 0; i < dns_cache_size; ++i ){
       dFree(dns_cache[i].hostname);
+      for ( j = 0; j < dList_length(dns_cache[i].addr_list); ++j)
+         dFree(dList_nth_data(dns_cache[i].addr_list, j));
+      dList_free(dns_cache[i].addr_list);
    }
    dFree(dns_cache);
 }