aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_circuitlist.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-09-03 10:58:11 -0400
committerNick Mathewson <nickm@torproject.org>2014-09-03 10:59:10 -0400
commitc4d0d30bf3e621d5f7a7b27a7480bcdabe6274c6 (patch)
tree240ecf67c15a16bf22e6c7a760410e8f3f8a2e87 /src/test/test_circuitlist.c
parent0e66edb25437385c50d4054727995d9f6b6be50d (diff)
downloadtor-c4d0d30bf3e621d5f7a7b27a7480bcdabe6274c6.tar.gz
tor-c4d0d30bf3e621d5f7a7b27a7480bcdabe6274c6.zip
Fix some 'dereference-before-null-check' warnings in test_circuitlist.c
Found by Coverity Scan. [CID 1234704, 1234705, 1234706]
Diffstat (limited to 'src/test/test_circuitlist.c')
-rw-r--r--src/test/test_circuitlist.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/test/test_circuitlist.c b/src/test/test_circuitlist.c
index 97c6b98ac3..53dcab3302 100644
--- a/src/test/test_circuitlist.c
+++ b/src/test/test_circuitlist.c
@@ -79,6 +79,10 @@ test_clist_maps(void *arg)
memset(&cam, 0, sizeof(cam));
memset(&cdm, 0, sizeof(cdm));
+ tt_assert(ch1);
+ tt_assert(ch2);
+ tt_assert(ch3);
+
ch1->cmux = tor_malloc(1);
ch2->cmux = tor_malloc(1);
ch3->cmux = tor_malloc(1);
@@ -161,7 +165,7 @@ test_clist_maps(void *arg)
if (ch2)
tor_free(ch2->cmux);
if (ch3)
- tor_free(ch3->cmux);
+ tor_free(ch3->cmux);
tor_free(ch1);
tor_free(ch2);
tor_free(ch3);