]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2009-03-22 Yoshinori K. Okuji <okuji@enbug.org>
authorokuji <okuji@localhost>
Sun, 22 Mar 2009 10:38:19 +0000 (10:38 +0000)
committerokuji <okuji@localhost>
Sun, 22 Mar 2009 10:38:19 +0000 (10:38 +0000)
    * kern/env.c (grub_env_context_close): Fix memory leaks.

ChangeLog
kern/env.c

index 350d44ff6b68b02b21de4262a1fcdde0fa243fc3..36d851db27dbb65a30b02c2f69f7c57750bbd842 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-03-22  Yoshinori K. Okuji  <okuji@enbug.org>
+
+       * kern/env.c (grub_env_context_close): Fix memory leaks.
+
 2009-03-22  Yoshinori K. Okuji  <okuji@enbug.org>
 
        * normal/main.c (grub_normal_execute): Added an argument
index 6a74c70a57a79e946d6e261e478e454810c5e925..5c69e280b2867e1f543fa2ad794223c758ae1147 100644 (file)
@@ -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 @@ grub_env_context_close (void)
       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);
        }
     }