1
0
Fork 0
mirror of https://repo.or.cz/socat.git synced 2025-07-09 05:46:32 +00:00

Option stderr leaked a temporary FD into child process

This commit is contained in:
Gerhard Rieger 2023-06-12 12:25:54 +02:00
parent 80f4aa8bcd
commit b3dde9a009
2 changed files with 4 additions and 0 deletions

View file

@ -472,6 +472,7 @@ int diag_dup(void) {
return -1;
}
newfd = dup(fileno(diagopts.logfile));
Fcntl_l(newfd, F_SETFD, FD_CLOEXEC);
if (diagopts.logfile != stderr) {
fclose(diagopts.logfile);
}