Explorar o código

Fix a coverity NULL-pointer deref warning in the DNS tests.

This is CID 1340251
Nick Mathewson %!s(int64=8) %!d(string=hai) anos
pai
achega
428e2b7636
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      src/test/test_dns.c

+ 2 - 1
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;