Commit ee9ccead authored by Niels Möller's avatar Niels Möller

(nettle_xrealloc): Fixed out-of-memory check.

Rev: src/nettle/realloc.c:1.2
parent f8ac6378
......@@ -41,9 +41,10 @@ void *
nettle_xrealloc(void *ctx UNUSED, void *p, unsigned length)
{
void *n = realloc(p, length);
if (n)
return n;
fprintf(stderr, "Virtual memory exhausted.\n");
abort();
if (length && !n)
{
fprintf(stderr, "Virtual memory exhausted.\n");
abort();
}
return n;
}
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