summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcypherpunks <cypherpunks@torproject.org>2015-12-04 15:47:59 +0100
committerteor (Tim Wilson-Brown) <teor2345@gmail.com>2015-12-06 20:24:07 +1100
commit16bec0dfd9e5cdd0faf99587c2261b148bc58011 (patch)
tree5789489906a6163f1ee3017c0c5c73eb6e6f5163 /src
parentee5337e90497e31c1ef18630c4f089e70bda5269 (diff)
downloadtor-16bec0dfd9e5cdd0faf99587c2261b148bc58011.tar.gz
tor-16bec0dfd9e5cdd0faf99587c2261b148bc58011.zip
Fix a memory leak in the exit policy parsing code
This memory leak only occurs when the Tor instance is not an exit node. Fixes code introduced in 10a6390deb3c9ff9fbd8078fc812abf6c77ad67f.
Diffstat (limited to 'src')
-rw-r--r--src/or/policies.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/policies.c b/src/or/policies.c
index 126ba465df..7f71b0df22 100644
--- a/src/or/policies.c
+++ b/src/or/policies.c
@@ -1350,7 +1350,7 @@ policies_parse_exit_policy_from_options(const or_options_t *or_options,
smartlist_t **result)
{
exit_policy_parser_cfg_t parser_cfg = 0;
- smartlist_t *configured_addresses = smartlist_new();
+ smartlist_t *configured_addresses;
int rv = 0;
/* Short-circuit for non-exit relays */
@@ -1360,6 +1360,8 @@ policies_parse_exit_policy_from_options(const or_options_t *or_options,
return 0;
}
+ configured_addresses = smartlist_new();
+
/* Configure the parser */
if (or_options->IPv6Exit) {
parser_cfg |= EXIT_POLICY_IPV6_ENABLED;