htpipe: Fixed socket leakage.
authorFredrik Tolf <fredrik@dolda2000.com>
Sat, 15 May 2021 01:29:16 +0000 (03:29 +0200)
committerFredrik Tolf <fredrik@dolda2000.com>
Sat, 15 May 2021 01:29:16 +0000 (03:29 +0200)
src/htpipe.c

index 223212e..27e5480 100644 (file)
@@ -124,6 +124,7 @@ static void runserver(int lsk, int ch)
                if((rfd = recvreq(cl[i], &req)) < 0) {
                    if(errno != 0)
                        flog(LOG_ERR, "htpipe: error from client: %s", strerror(errno));
+                   close(cl[i]);
                    cl[i] = -1;
                } else {
                    if(sendreq(ch, req, rfd)) {