* [PATCH liburing] examples/io_uring-test: Fix memory leak
@ 2025-01-12 18:08 Marcel Holtmann
2025-01-12 22:02 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Marcel Holtmann @ 2025-01-12 18:08 UTC (permalink / raw)
To: io-uring
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 <[email protected]>
---
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 d3fcc9ef2f5d..79574636a0d7 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;
}
--
2.47.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-01-12 22:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-12 18:08 [PATCH liburing] examples/io_uring-test: Fix memory leak Marcel Holtmann
2025-01-12 22:02 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox