mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 22:03:31 +01:00
Fix a memory leak introduced by the changes to test_options.c
Since this code passes the same options to options_validate() more than once, options_validate() needs to be prepared for that. (This previously worked by accident, since the smartlist of schedulers wasn't initialized.)
This commit is contained in:
parent
bd518b9ab1
commit
cb13930f2b
@ -3330,6 +3330,10 @@ options_validate_scheduler(or_options_t *options, char **msg)
|
||||
"can be used or set at least one value.");
|
||||
}
|
||||
/* Ok, we do have scheduler types, validate them. */
|
||||
if (options->SchedulerTypes_) {
|
||||
SMARTLIST_FOREACH(options->SchedulerTypes_, int *, iptr, tor_free(iptr));
|
||||
smartlist_free(options->SchedulerTypes_);
|
||||
}
|
||||
options->SchedulerTypes_ = smartlist_new();
|
||||
SMARTLIST_FOREACH_BEGIN(options->Schedulers, const char *, type) {
|
||||
int *sched_type;
|
||||
|
Loading…
Reference in New Issue
Block a user