diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-07-20 13:42:13 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-07-24 07:57:39 -0700 |
| commit | ccc24a8e508131a2226474642a038baaa2cbcc8c (patch) | |
| tree | 7029f7668fe3e1a9899da57bf6c1e60e0394bacb /src/core/defs.h | |
| parent | 9b9526e4a643d36d9c66f2254f00df7298e5562f (diff) | |
| download | nng-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.h | 4 |
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) \ |
