commit | 9248b61f54955e56212f3ae4c8a7ab704f7ad01c | [log] [tgz] |
---|---|---|
author | Lou Berger <lberger@labn.net> | Tue Jan 12 13:41:47 2016 -0500 |
committer | Paul Jakma <paul.jakma@hpe.com> | Fri Feb 26 14:11:41 2016 +0000 |
tree | d97f0d05991233191a400e6acaa6a164594a2d59 | |
parent | 672900382d47137638086bd8351b2678f589a546 [diff] |
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);