aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-02-11 16:32:13 -0500
committerNick Mathewson <nickm@torproject.org>2013-02-11 16:32:13 -0500
commit9b2bb901d7c306fd6ca28de527e86379470db89a (patch)
treee7546246802d306bcaf41034617b72415148f109 /src/test
parentfc35ee4910326dc1ae718482b30e57666a71df85 (diff)
downloadtor-9b2bb901d7c306fd6ca28de527e86379470db89a.tar
tor-9b2bb901d7c306fd6ca28de527e86379470db89a.tar.gz
Fix a null-deref-on-fail in unit tests
If geoip_format_bridge_stats() returned NULL when it should have returned a string, we would have tried to deref NULL, and died. Not a big deal in the unit tests, but still worth fixing. Found by coverity; This is CID 743384.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/test/test.c b/src/test/test.c
index be0737ceb..6c64d3599 100644
--- a/src/test/test.c
+++ b/src/test/test.c
@@ -1678,6 +1678,7 @@ test_geoip(void)
* the connecting clients added above. */
geoip_bridge_stats_init(now);
s = geoip_format_bridge_stats(now + 86400);
+ test_assert(s);
test_streq(bridge_stats_1, s);
tor_free(s);