lib: treat realloc of null pointer as alloc Now use zalloc rather than alloc with null. Fixes issue seen in bgp check tests.

Signed-off-by: Lou Berger <lberger@labn.net>
diff --git a/lib/memory.c b/lib/memory.c
index 172ddfc..269520d 100644
--- a/lib/memory.c
+++ b/lib/memory.c
@@ -108,6 +108,9 @@
 {
   void *memory;
 
+  if (ptr == NULL)              /* is really alloc */
+      return zcalloc(type, size);
+
   memory = realloc (ptr, size);
   if (memory == NULL)
     zerror ("realloc", type, size);