From 428e2b7636ed2430dd41d3a802290e971d2a081a Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 18 Dec 2015 10:27:30 -0500 Subject: [PATCH] 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 b781d6da53..6fdbe905e0 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;