aboutsummaryrefslogtreecommitdiff
path: root/src/app/config/statefile.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-07-23 09:08:31 -0400
committerNick Mathewson <nickm@torproject.org>2019-07-24 15:21:56 -0400
commitdde091ebc76d8ae5d93c1b3e1febfa2c9d1459fa (patch)
tree3673f25d9b098f0ebf8f10844232d4a8f7e13a9a /src/app/config/statefile.c
parent7abd43ac5f1e18e6a1c6bb2de95f39f22392f0c8 (diff)
downloadtor-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/app/config/statefile.c')
-rw-r--r--src/app/config/statefile.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/app/config/statefile.c b/src/app/config/statefile.c
index a44bcf6fb5..93e35659df 100644
--- a/src/app/config/statefile.c
+++ b/src/app/config/statefile.c
@@ -183,6 +183,7 @@ get_state_mgr(void)
{
if (PREDICT_UNLIKELY(state_mgr == NULL)) {
state_mgr = config_mgr_new(&state_format);
+ config_mgr_freeze(state_mgr);
}
return state_mgr;
}