libnv: Use mallocarray(9) for the nv_calloc.

This commit is contained in:
Pedro F. Giffuni 2018-01-19 14:50:53 +00:00
parent 77e7601e6d
commit 7326b4e68c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=328164

View File

@ -51,7 +51,7 @@ typedef struct nvpair nvpair_t;
#ifdef _KERNEL
#define nv_malloc(size) malloc((size), M_NVLIST, M_WAITOK)
#define nv_calloc(n, size) malloc((n) * (size), M_NVLIST, \
#define nv_calloc(n, size) mallocarray((n), (size), M_NVLIST, \
M_WAITOK | M_ZERO)
#define nv_realloc(buf, size) realloc((buf), (size), M_NVLIST, \
M_WAITOK)