Skip to content
Snippets Groups Projects
Commit 27889a95 authored by Niels Möller's avatar Niels Möller
Browse files

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

Rev: src/nettle/realloc.c:1.2
parent 766de8e4
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment