From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1EbVYl-0001YS-2h for mharc-grub-devel@gnu.org; Sun, 13 Nov 2005 23:03:11 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EbVYj-0001YA-5u for grub-devel@gnu.org; Sun, 13 Nov 2005 23:03:09 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EbVYf-0001Xy-Ld for grub-devel@gnu.org; Sun, 13 Nov 2005 23:03:08 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EbVYf-0001Xv-IT for grub-devel@gnu.org; Sun, 13 Nov 2005 23:03:05 -0500 Received: from [166.84.1.73] (helo=mail2.panix.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EbVYf-00046U-Ak for grub-devel@gnu.org; Sun, 13 Nov 2005 23:03:05 -0500 Received: from mailspool3.panix.com (mailspool3.panix.com [166.84.1.78]) by mail2.panix.com (Postfix) with ESMTP id EDD439DB1F for ; Sun, 13 Nov 2005 23:03:04 -0500 (EST) Received: from huxley.attbi.com (c-24-218-217-227.hsd1.ma.comcast.net [24.218.217.227]) by mailspool3.panix.com (Postfix) with ESMTP id 9FE37300711 for ; Sun, 13 Nov 2005 23:03:04 -0500 (EST) Received: from huxley.attbi.com (localhost [127.0.0.1]) by huxley.attbi.com (8.13.4/8.13.4/Debian-3) with ESMTP id jAE432PM020016 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sun, 13 Nov 2005 23:03:02 -0500 Received: (from smallm@localhost) by huxley.attbi.com (8.13.4/8.13.4/Submit) id jAE432k1020015 for grub-devel@gnu.org; Sun, 13 Nov 2005 23:03:02 -0500 From: Mike Small Date: Sun, 13 Nov 2005 23:03:02 -0500 To: grub-devel@gnu.org Message-ID: <20051114040302.GA3883@panix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.9i Subject: memory leak in normal/command.c(grub_command_find)? 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, 14 Nov 2005 04:03:09 -0000 Hello, It looks to me like there is a memory leak in grub_command_find: grub_command_t grub_command_find (char *cmdline) { ... again: for (cmd = grub_command_list; cmd; cmd = cmd->next) if (grub_strcmp (cmdline, cmd->name) == 0) break; if (! cmd) grub_error (GRUB_ERR_UNKNOWN_COMMAND, "unknown command `%s'", cmdline); else if (cmd->flags & GRUB_COMMAND_FLAG_NOT_LOADED) { /* Automatically load the command. */ if (count == 0) { grub_dl_t mod; char *module_name; module_name = grub_strdup (cmd->module_name); if (module_name) { mod = grub_dl_load (module_name); if (mod) { grub_dl_ref (mod); count++; goto again; } grub_free (module_name); <<<< never reached because of goto } } ... -- Mike Small smallm@panix.com