From: Jens Axboe Date: Sun, 24 Jun 2007 19:28:39 +0000 (+0200) Subject: net engine: fix listenfd/pipe fd leaks X-Git-Tag: fio-1.16.6~4 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=64b24cd8a5ea87bccec60e0236d93071480201e7;p=fio.git net engine: fix listenfd/pipe fd leaks Signed-off-by: Jens Axboe --- 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; }