aboutsummaryrefslogtreecommitdiff
path: root/src/or/shared_random_state.c
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2019-03-09 10:50:07 +1000
committerteor <teor@torproject.org>2019-03-09 11:59:52 +1000
commit9400da9b5e44bfce0684a3b36edb37465be514d6 (patch)
tree225a19812f54374069aa0b45cff53cf132ab2459 /src/or/shared_random_state.c
parent2e74edb53ef9ac417d8424a0785af839f83791ca (diff)
downloadtor-9400da9b5e44bfce0684a3b36edb37465be514d6.tar.gz
tor-9400da9b5e44bfce0684a3b36edb37465be514d6.zip
test/sr: Free SRVs before replacing them in test_sr_setup_srv()
Stop leaking parts of the shared random state in the shared-random unit tests. The previous fix in 29599 was incomplete. Fixes bug 29706; bugfix on 0.2.9.1-alpha.
Diffstat (limited to 'src/or/shared_random_state.c')
-rw-r--r--src/or/shared_random_state.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/shared_random_state.c b/src/or/shared_random_state.c
index 8438d46404..f27eccafc7 100644
--- a/src/or/shared_random_state.c
+++ b/src/or/shared_random_state.c
@@ -1007,7 +1007,7 @@ state_query(sr_state_action_t action, sr_state_object_t obj_type,
/* Delete the current SRV value from the state freeing it and the value is set
* to NULL meaning empty. */
-static void
+STATIC void
state_del_current_srv(void)
{
state_query(SR_STATE_ACTION_DEL, SR_STATE_OBJ_CURSRV, NULL, NULL);
@@ -1015,7 +1015,7 @@ state_del_current_srv(void)
/* Delete the previous SRV value from the state freeing it and the value is
* set to NULL meaning empty. */
-static void
+STATIC void
state_del_previous_srv(void)
{
state_query(SR_STATE_ACTION_DEL, SR_STATE_OBJ_PREVSRV, NULL, NULL);