* grub-core/lib/libgcrypt_wrap/mem.c (gcry_x*alloc): Make out of memory

fatal.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2013-01-12 16:27:37 +01:00
parent f7ff879bd2
commit 055b36b6a6
2 changed files with 30 additions and 5 deletions

View file

@ -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

View 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