diff options
author | Nick Mathewson <nickm@torproject.org> | 2005-08-22 00:34:42 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2005-08-22 00:34:42 +0000 |
commit | 9b6eeb81aa190dc5f15100bae3f4fd81ff05b245 (patch) | |
tree | b0c6da2c2e8eb71591398eb0944267b8f13027c4 | |
parent | 9321db8c2991a4e96f705b1e290d361021c0c229 (diff) | |
download | tor-9b6eeb81aa190dc5f15100bae3f4fd81ff05b245.tar.gz tor-9b6eeb81aa190dc5f15100bae3f4fd81ff05b245.zip |
Make unit tests run without segfaulting
svn:r4804
-rw-r--r-- | src/or/connection_edge.c | 3 | ||||
-rw-r--r-- | src/or/test.c | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index ba669fe8c3..8f1b93d3e2 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -871,6 +871,9 @@ addressmap_get_mappings(smartlist_t *sl, time_t min_expires, time_t max_expires) void *_val; addressmap_entry_t *val; + if (!addressmap) + addressmap_init(); + for (iter = strmap_iter_init(addressmap); !strmap_iter_done(iter); ) { strmap_iter_get(iter, &key, &_val); val = _val; diff --git a/src/or/test.c b/src/or/test.c index d6252061b4..604c68694d 100644 --- a/src/or/test.c +++ b/src/or/test.c @@ -1525,11 +1525,13 @@ main(int c, char**v) { or_options_t *options = options_new(); network_init(); + setup_directory(); options_init(options); + options->DataDirectory = tor_strdup(temp_dir); set_options(options); crypto_seed_rng(); - setup_directory(); + rep_hist_init(); atexit(remove_directory); |