commit e1ad0cf0b73a9ed594dfcb040044627b1e358e60
parent 37420efd2d6430a88d60edd2c373689069b3c26e
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Wed, 7 Feb 2018 20:48:52 +0100
fix minor fd leak regression in handlebin
Signed-off-by: Christoph Lohmann <20h@r-36.net>
Diffstat:
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/handlr.c b/handlr.c
@@ -116,6 +116,7 @@ handlebin(int sock, char *file, char *port, char *base, char *args,
if (fd >= 0) {
if (xsendfile(fd, sock) < 0)
perror("sendfile");
+ close(fd);
}
}
diff --git a/ind.c b/ind.c
@@ -71,7 +71,6 @@ pendingbytes(int sock)
void
waitforpendingbytes(int sock)
{
-
while (pendingbytes(sock) > 0)
usleep(10);
}