From: marco_g Date: Mon, 12 Jul 2004 17:53:07 +0000 (+0000) Subject: 2004-07-12 Marco Gerards X-Git-Tag: 1.98~2208 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5a9e354626a43866076a1598f6378bd5b672aa7b;p=thirdparty%2Fgrub.git 2004-07-12 Marco Gerards * 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. --- diff --git a/ChangeLog b/ChangeLog index 36c3c5e76..d814309fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-07-12 Marco Gerards + + * 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 * disk/powerpc/ieee1275/partition.c (grub_partition_iterate): Skip diff --git a/kern/mm.c b/kern/mm.c index ce46eb2ad..15b389824 100644 --- 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) diff --git a/normal/arg.c b/normal/arg.c index 11d9686c2..e66045c91 100644 --- a/normal/arg.c +++ b/normal/arg.c @@ -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;