]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2004-07-12 Marco Gerards <metgerards@student.han.nl>
authormarco_g <marco_g@localhost>
Mon, 12 Jul 2004 17:53:07 +0000 (17:53 +0000)
committermarco_g <marco_g@localhost>
Mon, 12 Jul 2004 17:53:07 +0000 (17:53 +0000)
* normal/arg.c (grub_arg_parse): Correct error handling after
reallocating the argumentlist (check if `argl' is not null instead
of checking if `args' is not null).
* kern/mm.c (grub_realloc): Return the same pointer when using the
same region, instead of returning the header address.

ChangeLog
kern/mm.c
normal/arg.c

index 36c3c5e76f9eadc43c0429394b9dace57f781062..d814309fa367502a9c02e7f133b37ee6bf1684e5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2004-07-12  Marco Gerards  <metgerards@student.han.nl>
+
+       * normal/arg.c (grub_arg_parse): Correct error handling after
+       reallocating the argumentlist (check if `argl' is not null instead
+       of checking if `args' is not null).
+       * kern/mm.c (grub_realloc): Return the same pointer when using the
+       same region, instead of returning the header address.
+
 2004-07-11  Marco Gerards  <metgerards@student.han.nl>
 
        * disk/powerpc/ieee1275/partition.c (grub_partition_iterate): Skip
index ce46eb2ad8f9f0e33220b25df6af8589db9d1e48..15b389824951c1df0ceaf1a569e8983109947854 100644 (file)
--- a/kern/mm.c
+++ b/kern/mm.c
@@ -335,7 +335,7 @@ grub_realloc (void *ptr, grub_size_t size)
   get_header_from_pointer (ptr, &p, &r);
   
   if (p->size >= n)
-    return p;
+    return ptr;
   
   q = grub_malloc (size);
   if (! q)
index 11d9686c2fe75565cfaf10f5dcc0a90fc809e1f1..e66045c9131022f9d6b9b6455fa482be7eb9b22a 100644 (file)
@@ -189,7 +189,7 @@ grub_arg_parse (grub_command_t cmd, int argc, char **argv,
   grub_err_t add_arg (char *s)
     {
       argl = grub_realloc (argl, (++num) * sizeof (char *));
-      if (! args)
+      if (! argl)
        return grub_errno;
       argl[num - 1] = s;
       return 0;