aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lb/lbhash.h
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2023-01-26 16:04:43 +0100
committerDamjan Marion <dmarion@0xa5.net>2023-03-06 17:55:08 +0000
commit064ff151504453220ae377f6092cd706d2e317e2 (patch)
tree9b55b516af107fc33111862324d48cef5bc78aaf /src/plugins/lb/lbhash.h
parent22460d6a873187d2130441958093808d23969a1f (diff)
lb: keep AddressSanitizer happy
vec_alloc() does not mark vector as accessible contrary to vec_validate(). Also removes redundant memset(0) as vector allocation always zeroed new memory. Type: fix Change-Id: I8309831b964a618454ed0bebbcdec7ec21149414 Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/plugins/lb/lbhash.h')
-rw-r--r--src/plugins/lb/lbhash.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/plugins/lb/lbhash.h b/src/plugins/lb/lbhash.h
index f822d79ded8..8253e9d52f0 100644
--- a/src/plugins/lb/lbhash.h
+++ b/src/plugins/lb/lbhash.h
@@ -88,8 +88,7 @@ lb_hash_t *lb_hash_alloc(u32 buckets, u32 timeout)
sizeof(lb_hash_bucket_t) * (buckets + 1);
u8 *mem = 0;
lb_hash_t *h;
- vec_alloc_aligned(mem, size, CLIB_CACHE_LINE_BYTES);
- clib_memset(mem, 0, size);
+ vec_validate_aligned (mem, size - 1, CLIB_CACHE_LINE_BYTES);
h = (lb_hash_t *)mem;
h->buckets_mask = (buckets - 1);
h->timeout = timeout;