aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-11-17 21:19:18 -0500
committerNick Mathewson <nickm@torproject.org>2017-11-18 10:22:14 -0500
commita5b8b55c1c39febdb0f8a2bc0294e040da21869a (patch)
tree4fa223084d0c7c1092cac1308171a2bccc9c963f /src
parent9c17a6d28b4acf044f408a0c7211e051e238c797 (diff)
downloadtor-a5b8b55c1c39febdb0f8a2bc0294e040da21869a.tar.gz
tor-a5b8b55c1c39febdb0f8a2bc0294e040da21869a.zip
Fix memory leak in unit test for bridge distribution config.
Also, check for the actual message, and fix some string confusion, while we're at it. Fixes bug 24345; bugfix on 0.3.2.3-alpha.
Diffstat (limited to 'src')
-rw-r--r--src/test/test_config.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/test/test_config.c b/src/test/test_config.c
index 456d8bcc3e..1c0dab39ca 100644
--- a/src/test/test_config.c
+++ b/src/test/test_config.c
@@ -5454,7 +5454,7 @@ test_config_check_bridge_distribution_setting_not_a_bridge(void *arg)
or_options_t* options = get_options_mutable();
or_options_t* old_options = options;
or_options_t* default_options = options;
- char* message = (char*)("");
+ char* message = NULL;
int ret;
(void)arg;
@@ -5465,8 +5465,11 @@ test_config_check_bridge_distribution_setting_not_a_bridge(void *arg)
ret = options_validate(old_options, options, default_options, 0, &message);
tt_int_op(ret, OP_EQ, -1);
+ tt_str_op(message, OP_EQ, "You set BridgeDistribution, but you "
+ "didn't set BridgeRelay!");
done:
- return;
+ tor_free(message);
+ options->BridgeDistribution = NULL;
}
/* If the BridgeDistribution setting was valid, 0 should be returned. */