From nobody@FreeBSD.org  Mon Aug 31 09:39:28 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3253A1065694
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 31 Aug 2009 09:39:28 +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 2154B8FC1C
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 31 Aug 2009 09:39:28 +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 n7V9dRJp032601
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 31 Aug 2009 09:39:27 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n7V9dRhc032598;
	Mon, 31 Aug 2009 09:39:27 GMT
	(envelope-from nobody)
Message-Id: <200908310939.n7V9dRhc032598@www.freebsd.org>
Date: Mon, 31 Aug 2009 09:39:27 GMT
From: Patroklos Argyroudis <argp@census-labs.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Memory leak in ficlIncludeFile() in file sys/boot/ficl/fileaccess.c
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         138375
>Category:       kern
>Synopsis:       [boot] [patch] Memory leak in ficlIncludeFile() in file sys/boot/ficl/fileaccess.c
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    brucec
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 31 09:40:05 UTC 2009
>Closed-Date:    Sat Mar 13 02:13:36 UTC 2010
>Last-Modified:  Sat Mar 13 02:13:36 UTC 2010
>Originator:     Patroklos Argyroudis
>Release:        8.0-CURRENT
>Organization:
census, inc
>Environment:
N/A
>Description:
In function ficlIncludeFile() in file sys/boot/ficl/fileaccess.c there is a memory leak of buffer which is allocated in line 219 and never freed.
>How-To-Repeat:
N/A
>Fix:
Patch attached.

Patch attached with submission follows:

--- ./sys/boot/ficl/fileaccess.c.orig	2009-08-27 16:46:00.000000000 +0300
+++ ./sys/boot/ficl/fileaccess.c	2009-08-27 16:54:02.000000000 +0300
@@ -268,6 +268,7 @@
 
     pVM->sourceID = id;
     closeFiclFILE(ff);
+    free(buffer);
 }
 
 


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->brucec  
Responsible-Changed-By: brucec 
Responsible-Changed-When: Sun Feb 28 14:33:39 UTC 2010 
Responsible-Changed-Why:  
Take. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=138375 
State-Changed-From-To: open->closed  
State-Changed-By: brucec 
State-Changed-When: Sat Mar 13 02:10:58 UTC 2010 
State-Changed-Why:  
The code in fileaccess.c isn't used in FreeBSD because we define FICL_WANT_FILE 
to 0.  However I've informed the upstream developer of the bug, and he expects 
the fix will be put into a new release at some point. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=138375 
>Unformatted:
