From 6795954bde09c8697e0accb865b4f438d62c601f Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 14 Aug 2023 19:59:20 -0600 Subject: [PATCH] engines/io_uring: fix leak of 'ld' in error path Not really important as we're exiting anyway, but this silences some of the static checkers that like to complain about this sort of thing. Signed-off-by: Jens Axboe --- engines/io_uring.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/engines/io_uring.c b/engines/io_uring.c index 7ac7c755..6cdf1b4f 100644 --- a/engines/io_uring.c +++ b/engines/io_uring.c @@ -1165,10 +1165,13 @@ static int fio_ioring_init(struct thread_data *td) md_size += td->o.mem_align - page_size; if (td->o.mem_type == MEM_MALLOC) { ld->md_buf = malloc(md_size); - if (!ld->md_buf) + if (!ld->md_buf) { + free(ld); return 1; + } } else { log_err("fio: Only iomem=malloc or mem=malloc is supported\n"); + free(ld); return 1; } } -- 2.25.1