mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-16 05:13:40 +00:00
Fix a leak in the recent fixes for file descriptors > SHRT_MAX. In the
case of a file descriptor we can't handle, clear the FILE structure's flags so it can be reused. MFC after: 1 week Reported by: otto @ OpenBSD
This commit is contained in:
parent
491851f994
commit
bc669a8c33
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=178427
|
@ -73,6 +73,7 @@ fopen(file, mode)
|
|||
* open.
|
||||
*/
|
||||
if (f > SHRT_MAX) {
|
||||
fp->_flags = 0; /* release */
|
||||
_close(f);
|
||||
errno = EMFILE;
|
||||
return (NULL);
|
||||
|
|
Loading…
Reference in a new issue