Date: Mon, 31 Aug 2009 09:15:13 GMT From: Patroklos Argyroudis <argp@census-labs.com> To: freebsd-gnats-submit@FreeBSD.org Subject: kern/138374: Resource leak in command_help() in file sys/boot/common/commands.c Message-ID: <200908310915.n7V9FDm8002621@www.freebsd.org> Resent-Message-ID: <200908310920.n7V9K3EK058872@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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 <topic> [<subtopic>]";
+ close(hfd);
return(CMD_ERROR);
}
>Release-Note:
>Audit-Trail:
>Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200908310915.n7V9FDm8002621>
