From: Vladimir 'phcoder' Serbinenko Date: Fri, 27 Nov 2009 08:41:24 +0000 (+0100) Subject: Add support for realloc (NULL, size) in relocators X-Git-Tag: 1.98~314^2~11 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c442639fc0411934c77f3f31e053ea626c357b32;p=thirdparty%2Fgrub.git Add support for realloc (NULL, size) in relocators --- 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);