Skip to content

Commit

Permalink
examples/io_uring-test: Fix memory leak
Browse files Browse the repository at this point in the history
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]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
holtmann authored and axboe committed Jan 12, 2025
1 parent 76bb80a commit 3124a46
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/io_uring-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 3124a46

Please sign in to comment.