From da78e2689134ea20e5730c3818263ac1c1e80818 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 22 Apr 2021 21:10:53 -0600 Subject: if_wg: properly use rn_inithead and rn_detachhead Signed-off-by: Jason A. Donenfeld --- src/wg_noise.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/wg_noise.c') diff --git a/src/wg_noise.c b/src/wg_noise.c index b188ece..10673b7 100644 --- a/src/wg_noise.c +++ b/src/wg_noise.c @@ -175,7 +175,8 @@ noise_local_alloc(void *arg) struct noise_local *l; size_t i; - if ((l = malloc(sizeof(*l), M_NOISE, M_NOWAIT)) == NULL) + l = malloc(sizeof(*l), M_NOISE, M_NOWAIT | M_ZERO); + if (!l) return (NULL); rw_init(&l->l_identity_lock, "noise_identity"); -- cgit v1.2.3-59-g8ed1b