C websockify: Fix file descriptor leak

After fork() the parent process has a copy of clients file descriptor which
needs to be closed by the parent to prevent a descriptor leak.
This commit is contained in:
Antti Seppälä 2018-02-17 17:21:54 +02:00
parent 3a03e3c59d
commit e7af149cd1
1 changed files with 1 additions and 0 deletions

View File

@ -861,6 +861,7 @@ void start_server() {
break; // Child process exits
} else { // parent process
settings.handler_id += 1;
close(csock);
}
}
if (pid == 0) {