aboutsummaryrefslogtreecommitdiff
path: root/src/or/shared_random_state.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-12-08 10:21:12 -0500
committerNick Mathewson <nickm@torproject.org>2017-12-08 14:47:19 -0500
commitfa0d24286b1dac3959c338f6b76fc15dbe1559e5 (patch)
tree5ec27cfa8b633cc6729bbb7da9eface2541ccb28 /src/or/shared_random_state.c
parent17dcce3fe11bfea9c7c46d2b9fd5baeb63ebe1e2 (diff)
downloadtor-fa0d24286b1dac3959c338f6b76fc15dbe1559e5.tar.gz
tor-fa0d24286b1dac3959c338f6b76fc15dbe1559e5.zip
Convert remaining function (mostly static) to new free style
Diffstat (limited to 'src/or/shared_random_state.c')
-rw-r--r--src/or/shared_random_state.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/or/shared_random_state.c b/src/or/shared_random_state.c
index 8c5a497bb3..d6109b2de7 100644
--- a/src/or/shared_random_state.c
+++ b/src/or/shared_random_state.c
@@ -274,9 +274,12 @@ commit_free_(void *p)
sr_commit_free_(p);
}
+#define state_free(val) \
+ FREE_AND_NULL(sr_state_t, state_free_, (val))
+
/* Free a state that was allocated with state_new(). */
static void
-state_free(sr_state_t *state)
+state_free_(sr_state_t *state)
{
if (state == NULL) {
return;
@@ -318,9 +321,12 @@ state_set(sr_state_t *state)
sr_state = state;
}
+#define disk_state_free(val) \
+ FREE_AND_NULL(sr_disk_state_t, disk_state_free_, (val))
+
/* Free an allocated disk state. */
static void
-disk_state_free(sr_disk_state_t *state)
+disk_state_free_(sr_disk_state_t *state)
{
if (state == NULL) {
return;
@@ -1286,7 +1292,7 @@ sr_state_srv_is_fresh(void)
/* Cleanup and free our disk and memory state. */
void
-sr_state_free(void)
+sr_state_free_all(void)
{
state_free(sr_state);
disk_state_free(sr_disk_state);