]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Add support for realloc (NULL, size) in relocators
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 27 Nov 2009 08:41:24 +0000 (09:41 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 27 Nov 2009 08:41:24 +0000 (09:41 +0100)
lib/relocator.c

index 176379eb775cd771043755bb8df2785d5261d368..d4bfebc8ead9b44da89d28a74c8ec6f9b8395e33 100644 (file)
@@ -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);