[or-cvs] r6969: fix a seg fault on exit for clients; and fix a comment. (tor/trunk/src/or)

arma at seul.org arma at seul.org
Thu Aug 3 04:22:29 UTC 2006


Author: arma
Date: 2006-08-03 00:22:25 -0400 (Thu, 03 Aug 2006)
New Revision: 6969

Modified:
   tor/trunk/src/or/dns.c
Log:
fix a seg fault on exit for clients; and fix a comment.


Modified: tor/trunk/src/or/dns.c
===================================================================
--- tor/trunk/src/or/dns.c	2006-08-03 01:50:10 UTC (rev 6968)
+++ tor/trunk/src/or/dns.c	2006-08-03 04:22:25 UTC (rev 6969)
@@ -91,8 +91,7 @@
   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 @@
     _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;
 }
 



More information about the tor-commits mailing list