[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



commit 428e2b7636ed2430dd41d3a802290e971d2a081a
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
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;



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits