]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix a memory leak in build_unopened_fourhop
authorNick Mathewson <nickm@torproject.org>
Wed, 24 Jan 2018 17:08:39 +0000 (12:08 -0500)
committerNick Mathewson <nickm@torproject.org>
Wed, 24 Jan 2018 17:08:39 +0000 (12:08 -0500)
This is a unit-test-only leak, but let's fix it anyway so it doesn't
hide real bugs.

Bug not in any released version of Tor.

src/test/test_circuitstats.c

index 9d87c325b45a467661d147da7f2912174e4efb72..8ebef659ca12d4e1e264a00914213c8a59510fad 100644 (file)
@@ -82,6 +82,8 @@ build_unopened_fourhop(struct timeval circ_start_time)
   onion_append_hop(&or_circ->cpath, fakehop);
   onion_append_hop(&or_circ->cpath, fakehop);
 
+  tor_free(fakehop);
+
   return or_circ;
 }