From owner-freebsd-bugs@FreeBSD.ORG Mon Aug 31 09:20:03 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A16D51065679 for ; Mon, 31 Aug 2009 09:20:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 65AE58FC1B for ; Mon, 31 Aug 2009 09:20:03 +0000 (UTC) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n7V9K3ef058873 for ; Mon, 31 Aug 2009 09:20:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n7V9K3EK058872; Mon, 31 Aug 2009 09:20:03 GMT (envelope-from gnats) Resent-Date: Mon, 31 Aug 2009 09:20:03 GMT Resent-Message-Id: <200908310920.n7V9K3EK058872@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Patroklos Argyroudis Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C7881065679 for ; Mon, 31 Aug 2009 09:15:14 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 3B4588FC08 for ; Mon, 31 Aug 2009 09:15:14 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n7V9FDrY002622 for ; Mon, 31 Aug 2009 09:15:13 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n7V9FDm8002621; Mon, 31 Aug 2009 09:15:13 GMT (envelope-from nobody) Message-Id: <200908310915.n7V9FDm8002621@www.freebsd.org> Date: Mon, 31 Aug 2009 09:15:13 GMT From: Patroklos Argyroudis To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/138374: Resource leak in command_help() in file sys/boot/common/commands.c X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Aug 2009 09:20:03 -0000 >Number: 138374 >Category: kern >Synopsis: Resource leak in command_help() in file sys/boot/common/commands.c >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Aug 31 09:20:03 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Patroklos Argyroudis >Release: 8.0-CURRENT >Organization: census, inc >Environment: N/A >Description: In function command_help() in file sys/boot/common/commands.c there is a resource leak of file descriptor hfd. Although the file descriptor is initialized in line 135, it is not closed. >How-To-Repeat: N/A >Fix: Patch attached. Patch attached with submission follows: --- ./sys/boot/common/commands.c.orig 2009-08-27 16:11:44.000000000 +0300 +++ ./sys/boot/common/commands.c 2009-08-27 16:22:06.000000000 +0300 @@ -150,6 +150,7 @@ break; default: command_errmsg = "usage is 'help []"; + close(hfd); return(CMD_ERROR); } >Release-Note: >Audit-Trail: >Unformatted: