]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix a memory leak in bench.c
authorNick Mathewson <nickm@torproject.org>
Wed, 18 Jan 2017 19:29:52 +0000 (14:29 -0500)
committerNick Mathewson <nickm@torproject.org>
Wed, 18 Jan 2017 19:29:52 +0000 (14:29 -0500)
src/test/bench.c

index 30984fda7008df4b07b19db41caebb534eb00d63..99bc686f30e835127fa3880c9b84ef5244b744e4 100644 (file)
@@ -120,7 +120,7 @@ bench_onion_TAP(void)
   uint64_t start, end;
   char os[TAP_ONIONSKIN_CHALLENGE_LEN];
   char or[TAP_ONIONSKIN_REPLY_LEN];
-  crypto_dh_t *dh_out;
+  crypto_dh_t *dh_out = NULL;
 
   key = crypto_pk_new();
   key2 = crypto_pk_new();
@@ -175,6 +175,7 @@ bench_onion_TAP(void)
          NANOCOUNT(start, end, iters)/1e3);
 
  done:
+  crypto_dh_free(dh_out);
   crypto_pk_free(key);
   crypto_pk_free(key2);
 }