From 64b24cd8a5ea87bccec60e0236d93071480201e7 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Sun, 24 Jun 2007 21:28:39 +0200 Subject: net engine: fix listenfd/pipe fd leaks Signed-off-by: Jens Axboe --- engines/net.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'engines') diff --git a/engines/net.c b/engines/net.c index bc3946d5..4538a04d 100644 --- a/engines/net.c +++ b/engines/net.c @@ -424,6 +424,13 @@ static void fio_netio_cleanup(struct thread_data *td) struct netio_data *nd = td->io_ops->data; if (nd) { + if (nd->listenfd != -1) + close(nd->listenfd); + if (nd->pipes[0] != -1) + close(nd->pipes[0]); + if (nd->pipes[1] != -1) + close(nd->pipes[1]); + free(nd); td->io_ops->data = NULL; } @@ -438,6 +445,7 @@ static int fio_netio_setup(struct thread_data *td) memset(nd, 0, sizeof(*nd)); nd->listenfd = -1; + nd->pipes[0] = nd->pipes[1] = -1; td->io_ops->data = nd; } -- cgit v1.2.3