From 9617ecf415bd092a9603ac956ea9e8b00e11bdb7 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 3 Oct 2018 12:29:46 -0600 Subject: [PATCH] iolog: fix leak for unsupported iolog version Signed-off-by: Jens Axboe --- iolog.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iolog.c b/iolog.c index 2f062892..b72dcf97 100644 --- a/iolog.c +++ b/iolog.c @@ -634,18 +634,18 @@ static bool init_iolog_read(struct thread_data *td) return false; } - td->io_log_rfile = f; - /* * version 2 of the iolog stores a specific string as the * first line, check for that */ if (!strncmp(iolog_ver2, buffer, strlen(iolog_ver2))) { free_release_files(td); + td->io_log_rfile = f; return read_iolog2(td); } log_err("fio: iolog version 1 is no longer supported\n"); + fclose(f); return false; } -- 2.25.1