aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2023-08-14 19:59:20 -0600
committerJens Axboe <axboe@kernel.dk>2023-08-14 19:59:20 -0600
commit6795954bde09c8697e0accb865b4f438d62c601f (patch)
tree966dec942ab8cd79734930f047b7c5d3441aec1b
parentd0f7d9fef46666a3b5f0a166d9d402bec302af78 (diff)
downloadfio-6795954bde09c8697e0accb865b4f438d62c601f.tar.gz
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 <axboe@kernel.dk>
-rw-r--r--engines/io_uring.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/engines/io_uring.c b/engines/io_uring.c
index 7ac7c755b..6cdf1b4fe 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;
}
}