From ccc24a8e508131a2226474642a038baaa2cbcc8c Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Fri, 20 Jul 2018 13:42:13 -0700 Subject: fixes #605 NNI_ALLOC_STRUCT/NNI_ALLOC_STRUCTS should zero memory --- src/core/defs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core/defs.h') diff --git a/src/core/defs.h b/src/core/defs.h index a0cca368..3a3f23ff 100644 --- a/src/core/defs.h +++ b/src/core/defs.h @@ -82,9 +82,9 @@ typedef struct { #define NNI_SECOND (1000) // Structure allocation conveniences. -#define NNI_ALLOC_STRUCT(s) nni_alloc(sizeof(*s)) +#define NNI_ALLOC_STRUCT(s) nni_zalloc(sizeof(*s)) #define NNI_FREE_STRUCT(s) nni_free((s), sizeof(*s)) -#define NNI_ALLOC_STRUCTS(s, n) nni_alloc(sizeof(*s) * n) +#define NNI_ALLOC_STRUCTS(s, n) nni_zalloc(sizeof(*s) * n) #define NNI_FREE_STRUCTS(s, n) nni_free(s, sizeof(*s) * n) #define NNI_PUT16(ptr, u) \ -- cgit v1.2.3-70-g09d2