summaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-02-16 15:40:15 -0500
committerNick Mathewson <nickm@torproject.org>2015-02-16 15:40:15 -0500
commit5d2a23397a3775eecb35bea23edffbef40b6cd94 (patch)
tree6680efe61ba7e04c346bf7f0c9238d82d17331a7 /src/or
parent7117959199a230cc7f1684794b8b13235b5f2715 (diff)
downloadtor-5d2a23397a3775eecb35bea23edffbef40b6cd94.tar.gz
tor-5d2a23397a3775eecb35bea23edffbef40b6cd94.zip
Fix a few coverity "Use after NULL check" warnings
Also remove the unit test mocks that allowed get_options() to be NULL; that's an invariant violation for get_options().
Diffstat (limited to 'src/or')
-rw-r--r--src/or/cpuworker.c3
-rw-r--r--src/or/status.c2
2 files changed, 2 insertions, 3 deletions
diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c
index 5787c75530..09ffdb81d1 100644
--- a/src/or/cpuworker.c
+++ b/src/or/cpuworker.c
@@ -359,8 +359,7 @@ cpuworker_onion_handshake_replyfn(void *work_)
log_debug(LD_OR,
"decoding onionskin failed. "
"(Old key or bad software.) Closing.");
- if (circ)
- circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_TORPROTOCOL);
+ circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_TORPROTOCOL);
goto done_processing;
}
diff --git a/src/or/status.c b/src/or/status.c
index 8057abef16..98db688e5b 100644
--- a/src/or/status.c
+++ b/src/or/status.c
@@ -132,7 +132,7 @@ log_heartbeat(time_t now)
circuit_log_ancient_one_hop_circuits(1800);
- if (options && options->BridgeRelay) {
+ if (options->BridgeRelay) {
char *msg = NULL;
msg = format_client_stats_heartbeat(now);
if (msg)