[2041] 2009-03-22 Yoshinori K.

"Yoshinori K. Okuji" <[email protected]>
Newsgroups gmane.comp.boot-loaders.grub.cvs
Message-ID <[email protected]>
Revision: 2041
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=2041
Author:   okuji
Date:     2009-03-22 10:38:19 +0000 (Sun, 22 Mar 2009)
Log Message:
-----------
2009-03-22  Yoshinori K. Okuji  <[email protected]>

    * kern/env.c (grub_env_context_close): Fix memory leaks.

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/kern/env.c

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog	2009-03-22 10:05:31 UTC (rev 2040)
+++ trunk/grub2/ChangeLog	2009-03-22 10:38:19 UTC (rev 2041)
@@ -1,5 +1,9 @@
 2009-03-22  Yoshinori K. Okuji  <[email protected]>
 
+	* kern/env.c (grub_env_context_close): Fix memory leaks.
+
+2009-03-22  Yoshinori K. Okuji  <[email protected]>
+
 	* normal/main.c (grub_normal_execute): Added an argument
 	BATCH to specify if an interactive interface should be provided
 	after reading a config file.

Modified: trunk/grub2/kern/env.c
===================================================================
--- trunk/grub2/kern/env.c	2009-03-22 10:05:31 UTC (rev 2040)
+++ trunk/grub2/kern/env.c	2009-03-22 10:38:19 UTC (rev 2041)
@@ -1,7 +1,7 @@
 /* env.c - Environment variables */
 /*
  *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2003,2005,2006,2007,2008  Free Software Foundation, Inc.
+ *  Copyright (C) 2003,2005,2006,2007,2008,2009  Free Software Foundation, Inc.
  *
  *  GRUB is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -127,6 +127,9 @@
       for (p = current_context->vars[i]; p; p = q)
 	{
 	  q = p->next;
+          grub_free (p->name);
+          if (p->type != GRUB_ENV_VAR_DATA)
+            grub_free (p->value);
 	  grub_free (p);
 	}
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.