diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-05-01 12:29:31 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-05-01 12:29:31 -0400 |
commit | b51ce907771d3fbeeb2dcba3c109d3ee25850f4c (patch) | |
tree | f968f0ab32c5b6c64dcd4f9c8695e6a1a32ae59d /src/test/test_config.c | |
parent | b6c8a14bf35c4572fba49be9eb4aaaa78d776c4c (diff) | |
parent | 3866792cd04d95c80eb5dd1e7cb2fddf0c05f9b8 (diff) | |
download | tor-b51ce907771d3fbeeb2dcba3c109d3ee25850f4c.tar tor-b51ce907771d3fbeeb2dcba3c109d3ee25850f4c.tar.gz |
Merge remote-tracking branch 'public/valgrind_tests'
Diffstat (limited to 'src/test/test_config.c')
-rw-r--r-- | src/test/test_config.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/test/test_config.c b/src/test/test_config.c index dbb50798b..d3e32525e 100644 --- a/src/test/test_config.c +++ b/src/test/test_config.c @@ -124,6 +124,7 @@ test_config_addressmap(void *arg) test_assert(!addressmap_rewrite(address, sizeof(address), &expires, NULL)); /* Test top-level-domain matching a bit harder */ + config_free_lines(get_options_mutable()->AddressMap); addressmap_clear_configured(); strlcpy(buf, "MapAddress *.com *.torserver.exit\n" "MapAddress *.torproject.org 1.1.1.1\n" @@ -153,6 +154,7 @@ test_config_addressmap(void *arg) test_streq(address, "2.2.2.2"); /* We don't support '*' as a mapping directive */ + config_free_lines(get_options_mutable()->AddressMap); addressmap_clear_configured(); strlcpy(buf, "MapAddress * *.torserver.exit\n", sizeof(buf)); config_get_lines(buf, &(get_options_mutable()->AddressMap), 0); @@ -170,7 +172,8 @@ test_config_addressmap(void *arg) #undef addressmap_rewrite done: - ; + config_free_lines(get_options_mutable()->AddressMap); + get_options_mutable()->AddressMap = NULL; } static int @@ -193,9 +196,9 @@ static void test_config_check_or_create_data_subdir(void *arg) { or_options_t *options = get_options_mutable(); - char *datadir = options->DataDirectory = tor_strdup(get_fname("datadir-0")); + char *datadir; const char *subdir = "test_stats"; - char *subpath = get_datadir_fname(subdir); + char *subpath; struct stat st; int r; #if !defined (_WIN32) || defined (WINCE) @@ -203,6 +206,10 @@ test_config_check_or_create_data_subdir(void *arg) #endif (void)arg; + tor_free(options->DataDirectory); + datadir = options->DataDirectory = tor_strdup(get_fname("datadir-0")); + subpath = get_datadir_fname(subdir); + #if defined (_WIN32) && !defined (WINCE) tt_int_op(mkdir(options->DataDirectory), ==, 0); #else @@ -251,7 +258,7 @@ static void test_config_write_to_data_subdir(void *arg) { or_options_t* options = get_options_mutable(); - char *datadir = options->DataDirectory = tor_strdup(get_fname("datadir-1")); + char *datadir; char *cp = NULL; const char* subdir = "test_stats"; const char* fname = "test_file"; @@ -273,6 +280,9 @@ test_config_write_to_data_subdir(void *arg) char* filepath = get_datadir_fname2(subdir, fname); (void)arg; + tor_free(options->DataDirectory); + datadir = options->DataDirectory = tor_strdup(get_fname("datadir-1")); + #if defined (_WIN32) && !defined (WINCE) tt_int_op(mkdir(options->DataDirectory), ==, 0); #else |