aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-08-03 04:22:25 +0000
committerRoger Dingledine <arma@torproject.org>2006-08-03 04:22:25 +0000
commit3152d44c3a56bdf85cab6d706f2f87a4894951a3 (patch)
treef066b60353098099b72cae654a31af16922a5a4e /src/or
parentb2c42635f0137fa4f56fd2f2fb48659a4762898f (diff)
downloadtor-3152d44c3a56bdf85cab6d706f2f87a4894951a3.tar
tor-3152d44c3a56bdf85cab6d706f2f87a4894951a3.tar.gz
fix a seg fault on exit for clients; and fix a comment.
svn:r6969
Diffstat (limited to 'src/or')
-rw-r--r--src/or/dns.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/dns.c b/src/or/dns.c
index 290bbc6c9..a61ff12de 100644
--- a/src/or/dns.c
+++ b/src/or/dns.c
@@ -91,8 +91,7 @@ typedef struct cached_resolve_t {
uint32_t magic;
char address[MAX_ADDRESSLEN]; /**< The hostname to be resolved. */
uint32_t addr; /**< IPv4 addr for <b>address</b>. */
- uint8_t state; /**< 0 is pending; 1 means answer is valid; 2 means resolve
- * failed. */
+ uint8_t state; /**< Is this cached entry pending/done/valid/failed? */
time_t expire; /**< Remove items from cache after this time. */
uint32_t ttl; /**< What TTL did the nameserver tell us? */
pending_connection_t *pending_connections;
@@ -264,7 +263,8 @@ dns_free_all(void)
_free_cached_resolve(item);
}
HT_CLEAR(cache_map, &cache_root);
- smartlist_free(cached_resolve_pqueue);
+ if (cached_resolve_pqueue)
+ smartlist_free(cached_resolve_pqueue);
cached_resolve_pqueue = NULL;
}