1
0
mirror of https://gitlab.xiph.org/xiph/ezstream.git synced 2024-11-03 04:17:18 -05:00

Unconditionally close allocated stderr FDs

This commit is contained in:
Moritz Grimm 2017-09-20 14:42:19 +02:00
parent ae85c26cae
commit 2cdda45c16

View File

@ -294,8 +294,7 @@ openResource(stream_t stream, const char *filename, int *popenFlag,
}
dup2(fd, fileno(stderr));
if (fd > 2)
close(fd);
close(fd);
}
fflush(NULL);
@ -316,7 +315,7 @@ openResource(stream_t stream, const char *filename, int *popenFlag,
if (cfg_get_program_quiet_stderr())
dup2(stderr_fd, fileno(stderr));
if (stderr_fd > 2)
if (stderr_fd != -1)
close(stderr_fd);
return (filep);