From 2b7625e25e32783272b8e6ffbc1546fa50b9386c Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Sat, 11 Jun 2016 21:41:13 -0600 Subject: [PATCH] iolog: fix 'cur_log' leaks Signed-off-by: Jens Axboe --- iolog.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/iolog.c b/iolog.c index 4ecf39ab..ff521df4 100644 --- a/iolog.c +++ b/iolog.c @@ -645,6 +645,7 @@ void free_log(struct io_log *log) cur_log = flist_first_entry(&log->io_logs, struct io_logs, list); flist_del_init(&cur_log->list); free(cur_log->log); + sfree(cur_log); } if (log->pending) { @@ -1227,9 +1228,7 @@ static int iolog_flush(struct io_log *log) data->samples = cur_log->log; data->nr_samples = cur_log->nr_samples; - cur_log->nr_samples = 0; - cur_log->max_samples = 0; - cur_log->log = NULL; + sfree(cur_log); gz_work(data); } -- 2.25.1