diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-07-23 09:08:31 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-07-24 15:21:56 -0400 |
commit | dde091ebc76d8ae5d93c1b3e1febfa2c9d1459fa (patch) | |
tree | 3673f25d9b098f0ebf8f10844232d4a8f7e13a9a /src/feature/dirauth/shared_random_state.c | |
parent | 7abd43ac5f1e18e6a1c6bb2de95f39f22392f0c8 (diff) | |
download | tor-dde091ebc76d8ae5d93c1b3e1febfa2c9d1459fa.tar.gz tor-dde091ebc76d8ae5d93c1b3e1febfa2c9d1459fa.zip |
Add a "freeze" function for config_mgr_t objects.
It's important to make sure that we don't change a config_mgr_t
after we start using it to make objects, or we could get into
inconsistent states. This feature is the start of a safety
mechanism to prevent this problem.
Diffstat (limited to 'src/feature/dirauth/shared_random_state.c')
-rw-r--r-- | src/feature/dirauth/shared_random_state.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/feature/dirauth/shared_random_state.c b/src/feature/dirauth/shared_random_state.c index a552e621ca..12ae79ce37 100644 --- a/src/feature/dirauth/shared_random_state.c +++ b/src/feature/dirauth/shared_random_state.c @@ -112,6 +112,7 @@ get_srs_mgr(void) { if (PREDICT_UNLIKELY(shared_random_state_mgr == NULL)) { shared_random_state_mgr = config_mgr_new(&state_format); + config_mgr_freeze(shared_random_state_mgr); } return shared_random_state_mgr; } |