From c442639fc0411934c77f3f31e053ea626c357b32 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Fri, 27 Nov 2009 09:41:24 +0100 Subject: [PATCH] Add support for realloc (NULL, size) in relocators --- lib/relocator.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/relocator.c b/lib/relocator.c index 176379eb7..d4bfebc8e 100644 --- a/lib/relocator.c +++ b/lib/relocator.c @@ -41,6 +41,9 @@ PREFIX (realloc) (void *relocator, grub_size_t size) { char *playground; + if (!relocator) + return PREFIX (alloc) (size); + playground = (char *) relocator - PRE_REGION_SIZE; playground = grub_realloc (playground, size + MAX_OVERHEAD);