From 3124a4619e4daf26b06d48ccf0186a947070c415 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 12 Jan 2025 19:08:30 +0100 Subject: [PATCH] examples/io_uring-test: Fix memory leak The iovecs structure is leaking even for the succesful case and since everything else gets cleaned up before exit, just free the iovecs allocated memory as well. Signed-off-by: Marcel Holtmann Link: https://lore.kernel.org/r/20250112180831.18612-1-marcel@holtmann.org Signed-off-by: Jens Axboe --- examples/io_uring-test.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/io_uring-test.c b/examples/io_uring-test.c index d3fcc9ef2..79574636a 100644 --- a/examples/io_uring-test.c +++ b/examples/io_uring-test.c @@ -108,5 +108,8 @@ int main(int argc, char *argv[]) (unsigned long) fsize); close(fd); io_uring_queue_exit(&ring); + for (i = 0; i < QD; i++) + free(iovecs[i].iov_base); + free(iovecs); return 0; }