aboutsummaryrefslogtreecommitdiff
path: root/src/or/dirvote.c
diff options
context:
space:
mode:
authorDaniel Pinto <danielpinto52@gmail.com>2016-08-16 17:53:38 +0100
committerDaniel Pinto <danielpinto52@gmail.com>2016-08-16 17:53:38 +0100
commit8c0fdf6a276077123c356f3fc9d29eebfc41db72 (patch)
tree1ac2994bf6a65d697da877847059911b97bf54aa /src/or/dirvote.c
parent5e571900b341b52a3176edaecfb6cbab8829efd1 (diff)
downloadtor-8c0fdf6a276077123c356f3fc9d29eebfc41db72.tar.gz
tor-8c0fdf6a276077123c356f3fc9d29eebfc41db72.zip
Added a voting_schedule_free function to free voting schedules.
Existing Uses of the tor_free function on voting schedules were replaced with voting_schedule_free. Fixes #19562.
Diffstat (limited to 'src/or/dirvote.c')
-rw-r--r--src/or/dirvote.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index 94a13e365d..7c80868194 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -2577,7 +2577,7 @@ get_next_valid_after_time(time_t now)
tor_assert(new_voting_schedule);
next_valid_after_time = new_voting_schedule->interval_starts;
- tor_free(new_voting_schedule);
+ free_voting_schedule(new_voting_schedule);
return next_valid_after_time;
}
@@ -2601,7 +2601,7 @@ dirvote_recalculate_timing(const or_options_t *options, time_t now)
/* Fill in the global static struct now */
memcpy(&voting_schedule, new_voting_schedule, sizeof(voting_schedule));
- tor_free(new_voting_schedule);
+ free_voting_schedule(new_voting_schedule);
}
/* Populate and return a new voting_schedule_t that can be used to schedule
@@ -2660,6 +2660,13 @@ get_voting_schedule(const or_options_t *options, time_t now, int severity)
return new_voting_schedule;
}
+/** Frees a voting_schedule_t. This should be used instead of the generic tor_free. */
+void
+free_voting_schedule(voting_schedule_t *voting_schedule_to_free)
+{
+ tor_free(voting_schedule_to_free);
+}
+
/** Entry point: Take whatever voting actions are pending as of <b>now</b>. */
void
dirvote_act(const or_options_t *options, time_t now)