summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-06-04 14:04:48 -0600
committerJens Axboe <axboe@kernel.dk>2019-06-04 14:04:48 -0600
commitb4b3d8c97b2de68e2bbac5f5a37988677c44302a (patch)
tree6e8da0f3e64d084eec537056e5fa832ab935aa8f /test
parentef9c4b40f7b42ebfd555c2e0cd0c30c7308a2300 (diff)
test/ring-leak: use static array for io_uring_register()
Don't leak the memory. We never need to reference it from the test app once the io_uring_register() call is done. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'test')
-rw-r--r--test/ring-leak.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/test/ring-leak.c b/test/ring-leak.c
index 71fe568..d2fcba0 100644
--- a/test/ring-leak.c
+++ b/test/ring-leak.c
@@ -25,11 +25,7 @@
static int io_uring_register_files(int ring_fd, int fd1, int fd2)
{
- __s32 *fds;
-
- fds = calloc(2, sizeof(__s32));
- fds[0] = fd1;
- fds[1] = fd2;
+ __s32 fds[2] = { fd1, fd2 };
return io_uring_register(ring_fd, IORING_REGISTER_FILES, fds, 2);
}