From 8ce9cd3dfab6a802272378e02695e87ebe40a973 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 21 Feb 2008 09:52:35 +0100 Subject: [PATCH 1/1] prune_io_piece_log() also needs to take list into account If we didn't use the rbtree but have remaining entries to prune, loop over the list as well and free those entries. Signed-off-by: Jens Axboe --- log.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/log.c b/log.c index e7320ef8..8754eb05 100644 --- a/log.c +++ b/log.c @@ -108,6 +108,12 @@ void prune_io_piece_log(struct thread_data *td) rb_erase(n, &td->io_hist_tree); free(ipo); } + + while (!list_empty(&td->io_hist_list)) { + ipo = list_entry(td->io_hist_list.next, struct io_piece, list); + list_del(&ipo->list); + free(ipo); + } } /* -- 2.25.1