Commit 4dc68a7d authored by Niels Möller's avatar Niels Möller

(xalloc): xalloc(0) should work also on

systems where malloc(0) returns NULL.

Rev: src/nettle/testsuite/testutils.c:1.25
parent ba2cda3a
......@@ -38,7 +38,7 @@ void *
xalloc(size_t size)
{
void *p = malloc(size);
if (!p)
if (size && !p)
{
fprintf(stderr, "Virtual memory exhausted.\n");
abort();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment