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