From 7457623865790f688a72dc20b420edadc56c5298 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sat, 3 Jun 2023 18:57:59 -0700 Subject: modules/rtv: plug non-snow-channel til_setup_t leak Somewhere along the line this leak was created, there's been a lot of activity surrounding this stuff so it's unsurprising. A little janky surrounding the conditional on snow module, but that's just how snow is handled today - it doesn't get randomized like the other channels do. --- src/modules/rtv/rtv.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/modules/rtv/rtv.c') diff --git a/src/modules/rtv/rtv.c b/src/modules/rtv/rtv.c index a73c9a5..9f7470b 100644 --- a/src/modules/rtv/rtv.c +++ b/src/modules/rtv/rtv.c @@ -123,6 +123,14 @@ static void cleanup_channel(rtv_context_t *ctxt) ctxt->channel->cumulative_time = 0; + /* we have to cleanup the non-snow module "baked" setups, it could happen + * immediately after the context create instead since the context holds a reference. + * just doing it here since it's an explicit cleanup block... snow doesn't get + * this treatment because we don't randomize its setup TODO revisit snow setup handling + */ + if (ctxt->channel != &ctxt->snow_channel) + ctxt->channel->module_setup = til_setup_free(ctxt->channel->module_setup); + ctxt->channel->module_ctxt = til_module_context_free(ctxt->channel->module_ctxt); free(ctxt->channel->settings_as_arg); -- cgit v1.2.1