* kern/mm.c (grub_real_malloc): Fix size calculation when extra == 0.
This commit is contained in:
parent
d1b61374ed
commit
2589383147
2 changed files with 12 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
|||
2010-05-01 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* kern/mm.c (grub_real_malloc): Fix size calculation when extra == 0.
|
||||
|
||||
2010-05-01 Christian Franke <franke@computer.org>
|
||||
|
||||
* util/grub-mkconfig_lib.in (make_system_path_relative_to_its_root):
|
||||
|
|
|
@ -251,13 +251,20 @@ grub_real_malloc (grub_mm_header_t *first, grub_size_t n, grub_size_t align)
|
|||
grub_mm_header_t r;
|
||||
|
||||
p->magic = GRUB_MM_ALLOC_MAGIC;
|
||||
p->size = n;
|
||||
|
||||
r = p + extra + n;
|
||||
r->magic = GRUB_MM_FREE_MAGIC;
|
||||
r->size = p->size - extra - n;
|
||||
r->next = p->next;
|
||||
q->next = r;
|
||||
|
||||
if (q == p)
|
||||
{
|
||||
q = r;
|
||||
r->next = r;
|
||||
}
|
||||
|
||||
p->size = n;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue