aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra/dlmalloc.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-07-28 04:53:30 -0700
committerFlorin Coras <fcoras@cisco.com>2018-07-28 04:53:30 -0700
commitd3ca8ffd0f095b9649b43cca5bb65fb82df3bb2a (patch)
tree3377e763f59d4253002aa73eea60b8bfa38e5462 /src/vppinfra/dlmalloc.c
parentd055475773b5741276edb818fb27478f532487b4 (diff)
session/dlmalloc: coverity fixes
Change-Id: I17ffec018f5d2fb06a7a3af6d8bc6128ffee3ae6 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vppinfra/dlmalloc.c')
-rw-r--r--src/vppinfra/dlmalloc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vppinfra/dlmalloc.c b/src/vppinfra/dlmalloc.c
index e5bd1e8a899..8ae92cf566c 100644
--- a/src/vppinfra/dlmalloc.c
+++ b/src/vppinfra/dlmalloc.c
@@ -1745,6 +1745,7 @@ static int init_mparams(void) {
#endif
{
+#ifndef DLM_MAGIC_CONSTANT
#if USE_DEV_RANDOM
int fd;
unsigned char buf[sizeof(size_t)];
@@ -1765,7 +1766,7 @@ static int init_mparams(void) {
#endif
magic |= (size_t)8U; /* ensure nonzero */
magic &= ~(size_t)7U; /* improve chances of fault for bad values */
-#ifdef DLM_MAGIC_CONSTANT
+#else
magic = DLM_MAGIC_CONSTANT;
#endif
/* Until memory modes commonly available, use volatile-write */