aboutsummaryrefslogtreecommitdiffstats
path: root/src/wg_noise.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/wg_noise.c')
-rw-r--r--src/wg_noise.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/wg_noise.c b/src/wg_noise.c
index 41f7f50..35784be 100644
--- a/src/wg_noise.c
+++ b/src/wg_noise.c
@@ -220,6 +220,9 @@ noise_local_put(struct noise_local *l)
if (refcount_release(&l->l_refcnt)) {
if (l->l_cleanup != NULL)
l->l_cleanup(l);
+ rw_destroy(&l->l_identity_lock);
+ rw_destroy(&l->l_remote_lock);
+ rw_destroy(&l->l_index_lock);
explicit_bzero(l, sizeof(*l));
free(l, M_NOISE);
}
@@ -468,6 +471,8 @@ noise_remote_smr_free(struct epoch_context *smr)
if (r->r_cleanup != NULL)
r->r_cleanup(r);
noise_local_put(r->r_local);
+ rw_destroy(&r->r_handshake_lock);
+ rw_destroy(&r->r_keypair_lock);
explicit_bzero(r, sizeof(*r));
free(r, M_NOISE);
}
@@ -749,6 +754,7 @@ noise_keypair_smr_free(struct epoch_context *smr)
struct noise_keypair *kp;
kp = __containerof(smr, struct noise_keypair, kp_smr);
noise_remote_put(kp->kp_remote);
+ rw_destroy(&kp->kp_nonce_lock);
explicit_bzero(kp, sizeof(*kp));
free(kp, M_NOISE);
}