diff options
author | Roger Dingledine <arma@torproject.org> | 2007-11-11 04:36:31 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2007-11-11 04:36:31 +0000 |
commit | 1b00492c40906e32b5b1431fc9e3080c5ecb9f78 (patch) | |
tree | b36c8eb55b9468be83e42d8823ba074c7d0baefc /src | |
parent | 0d219959569df2cfe933555d9fc9cd8397746e48 (diff) | |
download | tor-1b00492c40906e32b5b1431fc9e3080c5ecb9f78.tar tor-1b00492c40906e32b5b1431fc9e3080c5ecb9f78.tar.gz |
a potential solution for bug 549
svn:r12471
Diffstat (limited to 'src')
-rw-r--r-- | src/or/dns.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/or/dns.c b/src/or/dns.c index 08a224536..81daae796 100644 --- a/src/or/dns.c +++ b/src/or/dns.c @@ -377,16 +377,15 @@ purge_expired_resolves(time_t now) removed ? removed->address : "NULL", (void*)remove); } tor_assert(removed == resolve); - if (resolve->is_reverse) - tor_free(resolve->result.hostname); - resolve->magic = 0xF0BBF0BB; - tor_free(resolve); } else { /* This should be in state DONE. Make sure it's not in the cache. */ cached_resolve_t *tmp = HT_FIND(cache_map, &cache_root, resolve); tor_assert(tmp != resolve); - /* XXX020 shouldn't we be freeing 'resolve' here? */ } + if (resolve->is_reverse) + tor_free(resolve->result.hostname); + resolve->magic = 0xF0BBF0BB; + tor_free(resolve); } assert_cache_ok(); @@ -708,9 +707,8 @@ dns_resolve_impl(edge_connection_t *exitconn, int is_resolve, tor_fragile_assert(); } tor_assert(0); - } else if (resolve) { - log_warn(LD_BUG, "Found Mike's bug. Memory leak here!"); } + tor_assert(!resolve); /* not there, need to add it */ resolve = tor_malloc_zero(sizeof(cached_resolve_t)); resolve->magic = CACHED_RESOLVE_MAGIC; |