From owner-cvs-all@FreeBSD.ORG Mon Jun 7 21:45:53 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DA7CE16A4CE; Mon, 7 Jun 2004 21:45:53 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D522143D2D; Mon, 7 Jun 2004 21:45:53 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i57Ljieq036649; Mon, 7 Jun 2004 21:45:44 GMT (envelope-from rwatson@repoman.freebsd.org) Received: (from rwatson@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i57Lji5D036648; Mon, 7 Jun 2004 21:45:44 GMT (envelope-from rwatson) Message-Id: <200406072145.i57Lji5D036648@repoman.freebsd.org> From: Robert Watson Date: Mon, 7 Jun 2004 21:45:44 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/kern uipc_syscalls.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2004 21:45:54 -0000 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 Feet, hands provided by: Stefan Ehmann , Dimitry Andric Arjan van Leeuwen Revision Changes Path 1.188 +4 -4 src/sys/kern/uipc_syscalls.c