]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2007-09-03 Yoshinori K. Okuji <okuji@enbug.org>
authorokuji <okuji@localhost>
Mon, 3 Sep 2007 20:28:24 +0000 (20:28 +0000)
committerokuji <okuji@localhost>
Mon, 3 Sep 2007 20:28:24 +0000 (20:28 +0000)
    * kern/rescue.c (grub_enter_rescue_mode): Free ARGS.
    * normal/completion.c (grub_normal_do_completion): Likewise.
    Reported by Hitoshi Ozeki.

ChangeLog
kern/rescue.c
normal/completion.c

index 825053ac357c2ea89f13a73186216619cbeb1c52..7f8c412869de206b0e027c6e3c18f16feaf77f87 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2007-09-03  Yoshinori K. Okuji  <okuji@enbug.org>
 
+       * kern/rescue.c (grub_enter_rescue_mode): Free ARGS.
+       * normal/completion.c (grub_normal_do_completion): Likewise.
+       Reported by Hitoshi Ozeki.
+
+2007-09-03  Yoshinori K. Okuji  <okuji@enbug.org>
+       
        Do not use devices at boot in chainloading.
        
        * loader/i386/pc/chainloader.c (boot_drive): New variable.
index 662964bbd10137cf9f3afa796033bb8322f05b9b..9d7da10e7c5b4f6652ed227f377b9f72ee6717fe 100644 (file)
@@ -671,6 +671,7 @@ grub_enter_rescue_mode (void)
          val[0] = 0;
          grub_env_set (args[0], val + 1);
          val[0] = '=';
+          grub_free (args[0]);
          continue;
        }
 
@@ -679,7 +680,10 @@ grub_enter_rescue_mode (void)
 
       /* If nothing is specified, restart.  */
       if (*name == '\0')
-       continue;
+        {
+          grub_free (args[0]);
+          continue;
+        }
 
       /* Find the command and execute it.  */
       for (cmd = grub_rescue_command_list; cmd; cmd = cmd->next)
@@ -697,5 +701,7 @@ grub_enter_rescue_mode (void)
          grub_printf ("Unknown command `%s'\n", name);
          grub_printf ("Try `help' for usage\n");
        }
+
+      grub_free (args[0]);
     }
 }
index bad9e229267bc99fe887a1818289ed5ddabf0c68..e4b813ecffcde5a96a1d9a9e2ad62a1ce75f25ab 100644 (file)
@@ -473,18 +473,19 @@ grub_normal_do_completion (char *buf, int *restore,
       if (num_found == 1)
        grub_strcat (ret, suffix);
       
-      grub_free (match);
-
       if (*ret == '\0')
        {
          grub_free (ret);
-         return 0;
+          goto fail;
        }
       
+      grub_free (argv[0]);
+      grub_free (match);
       return ret;
     }
 
  fail:
+  grub_free (argv[0]);
   grub_free (match);
   grub_errno = GRUB_ERR_NONE;