From f1e59ffe5607ae8b84f03f153cacb27bc3024bac Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Mon, 13 Jun 2022 19:06:34 -0700 Subject: modules/sparkler: plug longstanding chunker leak Once upon a time this thing asserted the pinned chunks were empty, and that code is still sitting there commented out. But when it was commented out ages ago, to enable bulk freeing of chunkers without requiring unrefs of every allocation as an optimization, no code was added to free the pinned chunks. It's been easily ignored all this time since nobody really runs rototiller long enough to notice, but that's becoming less true now with how interesting something like: --module=rtv,layers=compose,duration=1,context_duration=1,snow_module=none is becoming... There are other leaks still, largely surrounding settings, but they are quite small. Eventually those will get tidied up as well. --- src/modules/sparkler/chunker.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/modules/sparkler') diff --git a/src/modules/sparkler/chunker.c b/src/modules/sparkler/chunker.c index 96dd911..8d97c49 100644 --- a/src/modules/sparkler/chunker.c +++ b/src/modules/sparkler/chunker.c @@ -199,6 +199,9 @@ void chunker_free_chunker(chunker_t *chunker) parameter. assert(list_empty(&chunker->pinned_chunks)); */ + list_for_each_entry_safe(chunk, _chunk, &chunker->pinned_chunks, chunks) { + free(chunk); + } list_for_each_entry_safe(chunk, _chunk, &chunker->free_chunks, chunks) { free(chunk); -- cgit v1.2.3