nhrpd: use CALLOC instead of MALLOC

in order to apply a memset to a non initialised structure, use CALLOC
instead of MALLOC

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
This commit is contained in:
Philippe Guibert 2019-07-16 15:04:33 +02:00
parent 4030737044
commit e8263bdb77

View File

@ -27,7 +27,7 @@ struct zbuf *zbuf_alloc(size_t size)
{
struct zbuf *zb;
zb = XMALLOC(MTYPE_ZBUF_DATA, sizeof(*zb) + size);
zb = XCALLOC(MTYPE_ZBUF_DATA, sizeof(*zb) + size);
zbuf_init(zb, zb + 1, size, 0);
zb->allocated = 1;