summaryrefslogtreecommitdiff
path: root/src/or/circuitbuild.c
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2018-04-27 15:27:44 +0300
committerMike Perry <mikeperry-git@torproject.org>2018-05-01 00:59:27 +0000
commite17f436fff541e0c31827f0e99bd345096d276e0 (patch)
tree1ef0de99c6d4e77d49714fa1565c949dccb24e95 /src/or/circuitbuild.c
parent627d2fdbf0903498807fdd21c59a91502d731f7d (diff)
downloadtor-e17f436fff541e0c31827f0e99bd345096d276e0.tar.gz
tor-e17f436fff541e0c31827f0e99bd345096d276e0.zip
Fix memleak found by unittests.
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r--src/or/circuitbuild.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 74e607d18f..1eb3947ae8 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -2633,7 +2633,9 @@ choose_good_middle_server(uint8_t purpose,
/** If a hidden service circuit wants a specific middle node, pin it. */
if (middle_node_must_be_vanguard(options, purpose, cur_len)) {
log_debug(LD_GENERAL, "Picking a sticky node (cur_len = %d)", cur_len);
- return pick_vanguard_middle_node(options, flags, cur_len, excluded);
+ choice = pick_vanguard_middle_node(options, flags, cur_len, excluded);
+ smartlist_free(excluded);
+ return choice;
}
choice = router_choose_random_node(excluded, options->ExcludeNodes, flags);