From: Jens Axboe Date: Tue, 15 Aug 2023 01:59:20 +0000 (-0600) Subject: engines/io_uring: fix leak of 'ld' in error path X-Git-Tag: fio-3.36~19 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=6795954bde09c8697e0accb865b4f438d62c601f;p=fio.git 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 --- 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; } }