summaryrefslogtreecommitdiff
path: root/src/test/bench.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-02-11 14:57:10 -0500
committerNick Mathewson <nickm@torproject.org>2013-02-11 14:57:10 -0500
commit717946089b6008e4744522845014dafa1fc4e37c (patch)
tree1750ca3984d902f8dc4bbb1f73a705cc174b3128 /src/test/bench.c
parentb9432becbe0ff10788e8f289b6562720822b7ece (diff)
downloadtor-717946089b6008e4744522845014dafa1fc4e37c.tar.gz
tor-717946089b6008e4744522845014dafa1fc4e37c.zip
Resolve memory leaks in the unit tests and benchmarks (found by coverity)
These shouldn't really matter, but it's nice to be leak-free.
Diffstat (limited to 'src/test/bench.c')
-rw-r--r--src/test/bench.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/test/bench.c b/src/test/bench.c
index d57aeb81aa..18a5154e11 100644
--- a/src/test/bench.c
+++ b/src/test/bench.c
@@ -164,6 +164,7 @@ bench_onion_TAP(void)
int s;
dh = crypto_dh_dup(dh_out);
s = onion_skin_TAP_client_handshake(dh, or, key_out, sizeof(key_out));
+ crypto_dh_free(dh);
tor_assert(s == 0);
}
end = perftime();
@@ -203,6 +204,7 @@ bench_onion_ntor(void)
end = perftime();
printf("Client-side, part 1: %f usec.\n", NANOCOUNT(start, end, iters)/1e3);
+ state = NULL;
onion_skin_ntor_create(nodeid, &keypair1.pubkey, &state, os);
start = perftime();
for (i = 0; i < iters; ++i) {