aboutsummaryrefslogtreecommitdiff
path: root/src/core/defs.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-07-20 13:42:13 -0700
committerGarrett D'Amore <garrett@damore.org>2018-07-24 07:57:39 -0700
commitccc24a8e508131a2226474642a038baaa2cbcc8c (patch)
tree7029f7668fe3e1a9899da57bf6c1e60e0394bacb /src/core/defs.h
parent9b9526e4a643d36d9c66f2254f00df7298e5562f (diff)
downloadnng-ccc24a8e508131a2226474642a038baaa2cbcc8c.tar.gz
nng-ccc24a8e508131a2226474642a038baaa2cbcc8c.tar.bz2
nng-ccc24a8e508131a2226474642a038baaa2cbcc8c.zip
fixes #605 NNI_ALLOC_STRUCT/NNI_ALLOC_STRUCTS should zero memory
Diffstat (limited to 'src/core/defs.h')
-rw-r--r--src/core/defs.h4
1 files changed, 2 insertions, 2 deletions
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) \