aboutsummaryrefslogtreecommitdiffstats
path: root/src/wg_noise.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-04-22 21:10:53 -0600
committerJason A. Donenfeld <Jason@zx2c4.com>2021-04-22 21:22:39 -0600
commitda78e2689134ea20e5730c3818263ac1c1e80818 (patch)
tree7f4d788d5ea82648e3cec7ea5c9be75eff208fbc /src/wg_noise.c
parentwg_cookie: allocate ratelimit table statically (diff)
downloadwireguard-freebsd-da78e2689134ea20e5730c3818263ac1c1e80818.tar.xz
wireguard-freebsd-da78e2689134ea20e5730c3818263ac1c1e80818.zip
if_wg: properly use rn_inithead and rn_detachhead
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/wg_noise.c')
-rw-r--r--src/wg_noise.c3
1 files changed, 2 insertions, 1 deletions
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");