]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
(xalloc): xalloc(0) should work also on
authorNiels Möller <nisse@lysator.liu.se>
Tue, 17 Feb 2004 15:43:58 +0000 (16:43 +0100)
committerNiels Möller <nisse@lysator.liu.se>
Tue, 17 Feb 2004 15:43:58 +0000 (16:43 +0100)
systems where malloc(0) returns NULL.

Rev: src/nettle/testsuite/testutils.c:1.25

testsuite/testutils.c

index 8dfcd68b944dd039382143d04ed7009c90dfbfad..6b2e548789ce01925253d2e9fc4fca705f281fad 100644 (file)
@@ -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();