From b4b3d8c97b2de68e2bbac5f5a37988677c44302a Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 4 Jun 2019 14:04:48 -0600 Subject: 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 --- test/ring-leak.c | 6 +----- 1 file changed, 1 insertion(+), 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); } -- cgit