]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/lib/libgcrypt_wrap/mem.c (gcry_x*alloc): Make out of memory
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 12 Jan 2013 15:27:37 +0000 (16:27 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 12 Jan 2013 15:27:37 +0000 (16:27 +0100)
fatal.

ChangeLog
grub-core/lib/libgcrypt_wrap/mem.c

index 8a1659121cfd6d5944e87878e3168fae45a2d9ab..4ac0aa6593147bd71a219ace6cdd5edda5eacd84 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-01-12  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/lib/libgcrypt_wrap/mem.c (gcry_x*alloc): Make out of memory
+       fatal.
+
 2013-01-12  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/lib/libgcrypt_wrap/mem.c (_gcry_log_bug): Make gcrypt bugs
index 64e8b6275397ee976dd085f8e6efed3fe8dc9cba..94f9d65d5d84430ac89ec611338a5a52ac286996 100644 (file)
@@ -35,31 +35,51 @@ gcry_is_secure (const void *a __attribute__ ((unused)))
 void *
 gcry_xcalloc (size_t n, size_t m)
 {
-  return grub_zalloc (n * m);
+  void *ret;
+  ret = grub_zalloc (n * m);
+  if (!ret)
+    grub_fatal ("gcry_xcalloc failed");
+  return ret;
 }
 
 void *
 gcry_xmalloc_secure (size_t n)
 {
-  return grub_malloc (n);
+  void *ret;
+  ret = grub_malloc (n);
+  if (!ret)
+    grub_fatal ("gcry_xmalloc failed");
+  return ret;
 }
 
 void *
 gcry_xcalloc_secure (size_t n, size_t m)
 {
-  return grub_zalloc (n * m);
+  void *ret;
+  ret = grub_zalloc (n * m);
+  if (!ret)
+    grub_fatal ("gcry_xcalloc failed");
+  return ret;
 }
 
 void *
 gcry_xmalloc (size_t n)
 {
-  return grub_malloc (n);
+  void *ret;
+  ret = grub_malloc (n);
+  if (!ret)
+    grub_fatal ("gcry_xmalloc failed");
+  return ret;
 }
 
 void *
 gcry_xrealloc (void *a, size_t n)
 {
-  return grub_realloc (a, n);
+  void *ret;
+  ret = grub_realloc (a, n);
+  if (!ret)
+    grub_fatal ("gcry_xrealloc failed");
+  return ret;
 }
 
 void