cvs commit: src/sys/kern uipc_syscalls.c
Robert Watson
rwatson at FreeBSD.org
Mon Jun 7 21:45:54 GMT 2004
rwatson 2004-06-07 21:45:44 UTC
FreeBSD src repository
Modified files:
sys/kern uipc_syscalls.c
Log:
Correct a resource leak introduced in recent accept locking changes:
when I reordered events in accept1() to allocate a file descriptor
earlier, I didn't properly update use of goto on exit to unwind for
cases where the file descriptor is now held, but wasn't previously.
The result was that, in the event of accept() on a non-blocking socket,
or in the event of a socket error, a file descriptor would be leaked.
This ended up being non-fatal in many cases, as the file descriptor
would be properly GC'd on process exit, so only showed up for processes
that do a lot of non-blocking accept() calls, and also live for a long
time (such as qmail).
This change updates the use of goto targets to do additional unwinding.
Eyes provided by: Brian Feldman <green at freebsd.org>
Feet, hands provided by: Stefan Ehmann <shoesoft at gmx.net>,
Dimitry Andric <dimitry at andric.com>
Arjan van Leeuwen <avleeuwen at piwebs.com>
Revision Changes Path
1.188 +4 -4 src/sys/kern/uipc_syscalls.c
More information about the cvs-src
mailing list