From: Jens Axboe Date: Wed, 3 Oct 2018 18:29:46 +0000 (-0600) Subject: iolog: fix leak for unsupported iolog version X-Git-Tag: fio-3.11~1 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=9617ecf415bd092a9603ac956ea9e8b00e11bdb7 iolog: fix leak for unsupported iolog version Signed-off-by: Jens Axboe --- 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; }