From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1EoN4H-0004AF-H6 for mharc-grub-devel@gnu.org; Mon, 19 Dec 2005 10:36:53 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EoN4D-00049G-MG for grub-devel@gnu.org; Mon, 19 Dec 2005 10:36:49 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EoN4A-00048F-HT for grub-devel@gnu.org; Mon, 19 Dec 2005 10:36:48 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EoN49-00047t-29 for grub-devel@gnu.org; Mon, 19 Dec 2005 10:36:45 -0500 Received: from [81.228.11.98] (helo=pne-smtpout1-sn1.fre.skanova.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EoN76-0003oo-Rr for grub-devel@gnu.org; Mon, 19 Dec 2005 10:39:49 -0500 Received: from [80.222.173.234] (80.222.173.234) by pne-smtpout1-sn1.fre.skanova.net (7.2.069.1) id 43A6AB1400010DDC for grub-devel@gnu.org; Mon, 19 Dec 2005 16:35:48 +0100 Message-ID: <43A6D35D.7080408@nic.fi> Date: Mon, 19 Dec 2005 17:35:57 +0200 From: =?ISO-8859-2?Q?Vesa_J=E4=E4skel=E4inen?= User-Agent: Thunderbird 1.4.1 (Windows/20051006) MIME-Version: 1.0 To: The development of GRUB 2 References: <4399FE01.7010402@nic.fi> <87mzj9q4z7.fsf@xs4all.nl> <439AA87B.9050607@nic.fi> <200512101411.11612.okuji@enbug.org> <439B369D.7020909@nic.fi> <43A44DA4.5090601@nic.fi> <1652.62.240.162.34.1134860376.squirrel@drak.ucw.cz> <43A49C6B.1080408@nic.fi> <43A641EF.3040909@comcast.net> In-Reply-To: <43A641EF.3040909@comcast.net> X-Enigmail-Version: 0.93.0.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 7bit Subject: Re: problem in usage of grub_errno... X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2005 15:36:50 -0000 Joel Buckley wrote: > There is a second bug though... > > A possible stack memory-leak is possible. Replace the > first line with the following to avoid the memory leak: > > if (grub_errno != GRUB_ERR_NONE) { > grub_error_push(); > } > > Otherwise, a useless push is done. Then you need to counter protect possible pop or pop will destroy one error message from stack. Eg. If you omit push, you can't do a pop. Now if you consistently use push/pop then there is no problem. Yes there will be unnecessary GRUB_ERR_NONE in stack, but it only takes one entry. Can you explain to me what is this your's memory leak :) Because I fail to see it. Please study the code in more detail.