[tor-commits] [tor/master] Fix a coverity NULL-pointer deref warning in the DNS tests.

nickm at torproject.org nickm at torproject.org
Fri Dec 18 15:36:04 UTC 2015


commit 428e2b7636ed2430dd41d3a802290e971d2a081a
Author: Nick Mathewson <nickm at torproject.org>
Date:   Fri Dec 18 10:27:30 2015 -0500

    Fix a coverity NULL-pointer deref warning in the DNS tests.
    
    This is CID 1340251
---
 src/test/test_dns.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/test/test_dns.c b/src/test/test_dns.c
index b781d6d..6fdbe90 100644
--- a/src/test/test_dns.c
+++ b/src/test/test_dns.c
@@ -738,7 +738,8 @@ NS(test_main)(void *arg)
   NS_UNMOCK(launch_resolve);
   tor_free(on_circ);
   tor_free(TO_CONN(exitconn)->address);
-  tor_free(cache_entry->pending_connections);
+  if (cache_entry)
+    tor_free(cache_entry->pending_connections);
   tor_free(cache_entry);
   tor_free(exitconn);
   return;





More information about the tor-commits mailing list