diff --git a/sys/dev/wg/if_wg.c b/sys/dev/wg/if_wg.c --- a/sys/dev/wg/if_wg.c +++ b/sys/dev/wg/if_wg.c @@ -2452,8 +2452,7 @@ sx_xunlock(&sc->sc_lock); nvlist_destroy(nvl); out: - explicit_bzero(nvlpacked, wgd->wgd_size); - free(nvlpacked, M_TEMP); + zfree(nvlpacked, M_TEMP); return (err); } @@ -2577,8 +2576,7 @@ wgd->wgd_size = size; out: - explicit_bzero(packed, size); - free(packed, M_NVLIST); + zfree(packed, M_NVLIST); err: nvlist_destroy(nvl); return (err); diff --git a/sys/dev/wg/wg_noise.c b/sys/dev/wg/wg_noise.c --- a/sys/dev/wg/wg_noise.c +++ b/sys/dev/wg/wg_noise.c @@ -223,8 +223,7 @@ rw_destroy(&l->l_identity_lock); mtx_destroy(&l->l_remote_mtx); mtx_destroy(&l->l_index_mtx); - explicit_bzero(l, sizeof(*l)); - free(l, M_NOISE); + zfree(l, M_NOISE); } } @@ -472,8 +471,7 @@ noise_local_put(r->r_local); rw_destroy(&r->r_handshake_lock); mtx_destroy(&r->r_keypair_mtx); - explicit_bzero(r, sizeof(*r)); - free(r, M_NOISE); + zfree(r, M_NOISE); } void @@ -754,8 +752,7 @@ 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); + zfree(kp, M_NOISE); } void